Enable NV12 support
Subsystems (2)
v4 cover Enable NV12 support
Enabling NV12 support:
- Framebuffer creation
- Primary and Sprite plane support
Patch series depend on Enable display workaround 827 patch mentioned below submitted by Maarten
Changes from prev version:
Included RB from Maarten for patches
Included RB from Kristian
Chandra Konduru (3):
drm/i915: Add NV12 as supported format for primary plane drm/i915: Add NV12 as supported format for sprite plane drm/i915: Add NV12 support to intel_framebuffer_init
Maarten Lankhorst (2):
drm/i915: Enable display workaround 827 for all planes, v2. drm/i915: Add skl_check_nv12_surface for NV12
Vidya Srinivas (1):
drm/i915: Enable Display WA 0528
drivers/gpu/drm/i915/intel_atomic_plane.c | 7 +- drivers/gpu/drm/i915/intel_display.c | 169 ++++++++++++++++++++++++++---- drivers/gpu/drm/i915/intel_drv.h | 3 + drivers/gpu/drm/i915/intel_sprite.c | 44 ++++++-- 4 files changed, 198 insertions(+), 25 deletions(-)
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 1/6 drm/i915: Enable display workaround 827 for all planes, v2.
From: Maarten Lankhorst <[email protected]>
The workaround was applied only to the primary plane, but is required on all planes. Iterate over all planes in the crtc atomic check to see if the workaround is enabled, and only perform the actual toggling in the pre/post plane update functions.
Changes since v1:
- Track active NV12 planes in a nv12_planes bitmask. (Ville)
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 7 +++++- drivers/gpu/drm/i915/intel_display.c | 40 ++++++++++++++++++------------- drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 30 insertions(+), 18 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +6 -1
@@ -183,11 +183,16 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ }/* FIXME pre-g4x don't work like this */ -if (intel_state->base.visible) +if (state->visible) crtc_state->active_planes |=BIT (intel_plane->id);else crtc_state->active_planes &= ~BIT (intel_plane->id); +if (state->visible && state->fb->format->format ==DRM_FORMAT_NV12 ) + crtc_state->nv12_planes |=BIT (intel_plane->id); +else + crtc_state->nv12_planes &= ~BIT (intel_plane->id); + return intel_plane_atomic_calc_changes(old_crtc_state, &crtc_state->base, old_plane_state,
drivers/gpu/drm/i915/intel_display.c +23 -17
@@ -5138,6 +5138,19 @@ static bool hsw_post_update_enable_ips(const struct intel_crtc_state *old_crtc_sreturn !old_crtc_state->ips_enabled; } +static bool needs_nv12_wa (struct drm_i915_private *dev_priv, +const struct intel_crtc_state *crtc_state) +{ +if (!crtc_state->nv12_planes) +return false; + +if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || +IS_CANNONLAKE (dev_priv)) +return true; + +return false; +} +static void intel_post_plane_update (struct intel_crtc_state *old_crtc_state) {struct intel_crtc *crtc =to_intel_crtc (old_crtc_state->base.crtc);
@@ -5162,7 +5175,6 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)if (old_primary_state) {struct drm_plane_state *new_primary_state =drm_atomic_get_new_plane_state (old_state, primary); -struct drm_framebuffer *fb = new_primary_state->fb;intel_fbc_post_update (crtc);
@@ -5170,15 +5182,12 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state) (needs_modeset(&pipe_config->base) || !old_primary_state->visible))intel_post_enable_primary (&crtc->base, pipe_config); - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, false); - } - } + +/* Display WA 827 */ +if (needs_nv12_wa (dev_priv, old_crtc_state) && + !needs_nv12_wa (dev_priv, pipe_config)) +skl_wa_clkgate (dev_priv, crtc->pipe, false); } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
@@ -5202,14 +5211,6 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,struct intel_plane_state *new_primary_state =intel_atomic_get_new_plane_state (old_intel_state,to_intel_plane (primary)); -struct drm_framebuffer *fb = new_primary_state->base.fb; - -/* Display WA 827 */ -if ((INTEL_GEN (dev_priv) ==9 && !IS_GEMINILAKE (dev_priv)) || -IS_CANNONLAKE (dev_priv)) { -if (fb && fb->format->format ==DRM_FORMAT_NV12 ) -skl_wa_clkgate (dev_priv, crtc->pipe, true); - }intel_fbc_pre_update (crtc, pipe_config, new_primary_state);/*
@@ -5221,6 +5222,11 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,intel_set_cpu_fifo_underrun_reporting (dev_priv, crtc->pipe, false); } +/* Display WA 827 */ +if (!needs_nv12_wa (dev_priv, old_crtc_state) && +needs_nv12_wa (dev_priv, pipe_config)) +skl_wa_clkgate (dev_priv, crtc->pipe, true); +/* * Vblank time updates from the shadow to live plane control register * are blocked if the memory self-refresh mode is active at that
drivers/gpu/drm/i915/intel_drv.h +1 -0
@@ -882,6 +882,7 @@ struct intel_crtc_state {/* bitmask of visible planes (enum plane_id) */ u8 active_planes; +u8 nv12_planes;/* HDMI scrambling status */ bool hdmi_scrambling;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 2/6 drm/i915: Add NV12 as supported format for primary plane
In reply to Vidya SrinivasFrom: Chandra Konduru <[email protected]>
This patch adds NV12 to list of supported formats for primary plane
v2: Rebased (Chandra Konduru)
v3: Rebased (me)
v4: Review comments by Ville addressed
Removed the skl_primary_formats_with_nv12 and
added NV12 case in existing skl_primary_formats
v5: Rebased (me)
v6: Missed the Tested-by/Reviewed-by in the previous series Adding the same to commit message in this version.
v7: Review comments by Ville addressed
Restricting the NV12 for BXT and on PIPE A and B
Rebased (me)
v8: Rebased (me)
Modified restricting the NV12 support for both BXT and KBL.
v9: Rebased (me)
v10: Addressed review comments from Maarten.
Adding NV12 inside skl_primary_formats itself.
v11: Adding Reviewed By tag from Shashank Sharma
v12: Addressed review comments from Juha-Pekka Heikkila "NV12 not to be supported by SKL"
v13: Addressed review comments from Ville
Added skl_pri_planar_formats to include NV12
and skl_plane_has_planar function to check for
NV12 support on plane. Added NV12 format toskl_mod_supported. These were review comments
from Kristian Høgsberg <[email protected]>
v14: Added reviewed by from Juha-Pekka Heikkila
v15: Rebased the series
v16: Added all tiling support under mod supported
for NV12. Credits to Megha Aggarwal
v17: Added RB by Maarten and Kristian
Credits-to: Megha Aggarwal [email protected]
--- drivers/gpu/drm/i915/intel_display.c | 55 ++++++++++++++++++++++++++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 2 ++ 2 files changed, 55 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +53 -2
@@ -88,6 +88,22 @@ static const uint32_t skl_primary_formats[] = { DRM_FORMAT_VYUY, }; +static const uint32_t skl_pri_planar_formats[] = { +DRM_FORMAT_C8 , +DRM_FORMAT_RGB565 , +DRM_FORMAT_XRGB8888 , +DRM_FORMAT_XBGR8888 , +DRM_FORMAT_ARGB8888 , +DRM_FORMAT_ABGR8888 , +DRM_FORMAT_XRGB2101010 , +DRM_FORMAT_XBGR2101010 , +DRM_FORMAT_YUYV , +DRM_FORMAT_YVYU , +DRM_FORMAT_UYVY , +DRM_FORMAT_VYUY , +DRM_FORMAT_NV12 , +}; +static const uint64_t skl_format_modifiers_noccs[] = { I915_FORMAT_MOD_Yf_TILED,I915_FORMAT_MOD_Y_TILED ,
@@ -13124,6 +13140,12 @@ static bool skl_mod_supported(uint32_t format, uint64_t modifier)if (modifier == I915_FORMAT_MOD_Yf_TILED)return true;/* fall through */ +case DRM_FORMAT_NV12 : +if (modifier ==DRM_FORMAT_MOD_LINEAR || + modifier ==I915_FORMAT_MOD_X_TILED || + modifier ==I915_FORMAT_MOD_Y_TILED || + modifier == I915_FORMAT_MOD_Yf_TILED) +return true;case DRM_FORMAT_C8 : if (modifier == DRM_FORMAT_MOD_LINEAR || modifier == I915_FORMAT_MOD_X_TILED ||
@@ -13328,6 +13350,30 @@ static bool skl_plane_has_fbc(struct drm_i915_private *dev_priv,return pipe ==PIPE_A && plane_id ==PLANE_PRIMARY ; } +bool skl_plane_has_planar (struct drm_i915_private *dev_priv, +enum pipe pipe,enum plane_id plane_id) +{ +if (plane_id ==PLANE_PRIMARY ) { +if (IS_SKYLAKE (dev_priv)) +return false; +else if ((INTEL_GEN (dev_priv) ==9 && pipe ==PIPE_C ) && + !IS_GEMINILAKE (dev_priv)) +return false; + }else if (plane_id >=PLANE_SPRITE0 ) { +if (plane_id ==PLANE_CURSOR ) +return false; +if (IS_GEMINILAKE (dev_priv) ||INTEL_GEN (dev_priv) ==10 ) { +if (plane_id !=PLANE_SPRITE0 ) +return false; + }else { +if (plane_id !=PLANE_SPRITE0 || pipe ==PIPE_C || +IS_SKYLAKE (dev_priv)) +return false; + } + } +return true; +} +static struct intel_plane *intel_primary_plane_create (struct drm_i915_private *dev_priv,enum pipe pipe) {
@@ -13388,8 +13434,13 @@ intel_primary_plane_create(struct drm_i915_private *dev_priv, enum pipe pipe) primary->check_plane = intel_check_primary_plane;if (INTEL_GEN (dev_priv) >=9 ) { - intel_primary_formats = skl_primary_formats; - num_formats =ARRAY_SIZE (skl_primary_formats); +if (skl_plane_has_planar (dev_priv, pipe,PLANE_PRIMARY )) { + intel_primary_formats = skl_pri_planar_formats; + num_formats =ARRAY_SIZE (skl_pri_planar_formats); + }else { + intel_primary_formats = skl_primary_formats; + num_formats =ARRAY_SIZE (skl_primary_formats); + }if (skl_plane_has_ccs (dev_priv, pipe,PLANE_PRIMARY )) modifiers = skl_format_modifiers_ccs;
drivers/gpu/drm/i915/intel_drv.h +2 -0
@@ -2063,6 +2063,8 @@ bool skl_plane_get_hw_state(struct intel_plane *plane);bool skl_plane_has_ccs (struct drm_i915_private *dev_priv,enum pipe pipe,enum plane_id plane_id);bool intel_format_is_yuv (uint32_t format); +bool skl_plane_has_planar (struct drm_i915_private *dev_priv, +enum pipe pipe,enum plane_id plane_id);/* intel_tv.c */ void intel_tv_init (struct drm_i915_private *dev_priv);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 3/6 drm/i915: Add NV12 as supported format for sprite plane
In reply to Vidya SrinivasFrom: Chandra Konduru <[email protected]>
This patch adds NV12 to list of supported formats for sprite plane.
v2: Rebased (me)
v3: Review comments by Ville addressed
- Removed skl_plane_formats_with_nv12 and added
NV12 case in existing skl_plane_formats
- Added the 10bpc RGB formats
v4: Addressed review comments from Clinton A Taylor
"Why are we adding 10 bit RGB formats with the NV12 series patches? Trying to set XR30 or AB30 results in error returned even though the modes are advertised for the planes"
- Removed 10bit RGB formats added previously with NV12 series
v5: Missed the Tested-by/Reviewed-by in the previous series Adding the same to commit message in this version. Addressed review comments from Clinton A Taylor
"Why are we adding 10 bit RGB formats with the NV12 series patches? Trying to set XR30 or AB30 results in error returned even though the modes are advertised for the planes"
- Previous version has 10bit RGB format removed from VLV formats by mistake. Fixing that in this version.
Removed 10bit RGB formats added previously with NV12 series for SKL.
v6: Addressed review comments by Ville
Restricting the NV12 to BXT and PIPE A and B
v7: Rebased (me)
v8: Rebased (me)
Restricting NV12 changes to BXT and KBL
Restricting NV12 changes for plane 0 (overlay)
v9: Rebased (me)
v10: Addressed review comments from Maarten.
Adding NV12 to skl_plane_formats itself.
v11: Addressed review comments from Shashank Sharma
v12: Addressed review comments from Shashank Sharma Made the condition in intel_sprite_plane_create simple and easy to read as suggested.
v13: Adding reviewed by tag from Shashank Sharma Addressed review comments from Juha-Pekka Heikkila "NV12 not to be supported by SKL"
v14: Addressed review comments from Ville
Added skl_planar_formats to include NV12
and a check skl_plane_has_planar in sprite create Added NV12 format to skl_mod_supported. These were review comments from Kristian Høgsberg <[email protected]>
v15: Added reviewed by from Juha-Pekka Heikkila
v16: Rebased the series
v17: Added all tiling under mod supported for NV12 Credits to Megha Aggarwal
v18: Added RB by Maarten and Kristian
Credits-to: Megha Aggarwal <[email protected]>
Credits-to: Kristian Høgsberg <[email protected]>
--- drivers/gpu/drm/i915/intel_sprite.c | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_sprite.c +27 -2
@@ -1253,6 +1253,19 @@ static uint32_t skl_plane_formats[] = { DRM_FORMAT_VYUY, }; +static uint32_t skl_planar_formats[] = { +DRM_FORMAT_RGB565 , +DRM_FORMAT_ABGR8888 , +DRM_FORMAT_ARGB8888 , +DRM_FORMAT_XBGR8888 , +DRM_FORMAT_XRGB8888 , +DRM_FORMAT_YUYV , +DRM_FORMAT_YVYU , +DRM_FORMAT_UYVY , +DRM_FORMAT_VYUY , +DRM_FORMAT_NV12 , +}; +static const uint64_t skl_plane_format_modifiers_noccs[] = { I915_FORMAT_MOD_Yf_TILED,I915_FORMAT_MOD_Y_TILED ,
@@ -1350,6 +1363,12 @@ static bool skl_mod_supported(uint32_t format, uint64_t modifier)if (modifier == I915_FORMAT_MOD_Yf_TILED)return true;/* fall through */ +case DRM_FORMAT_NV12 : +if (modifier ==DRM_FORMAT_MOD_LINEAR || + modifier ==I915_FORMAT_MOD_X_TILED || + modifier ==I915_FORMAT_MOD_Y_TILED || + modifier == I915_FORMAT_MOD_Yf_TILED) +return true;case DRM_FORMAT_C8 : if (modifier == DRM_FORMAT_MOD_LINEAR || modifier == I915_FORMAT_MOD_X_TILED ||
@@ -1446,8 +1465,14 @@ intel_sprite_plane_create(struct drm_i915_private *dev_priv, intel_plane->disable_plane = skl_disable_plane; intel_plane->get_hw_state = skl_plane_get_hw_state; - plane_formats = skl_plane_formats; - num_plane_formats =ARRAY_SIZE (skl_plane_formats); +if (skl_plane_has_planar (dev_priv, pipe, +PLANE_SPRITE0 + plane)) { + plane_formats = skl_planar_formats; + num_plane_formats =ARRAY_SIZE (skl_planar_formats); + }else { + plane_formats = skl_plane_formats; + num_plane_formats =ARRAY_SIZE (skl_plane_formats); + }if (skl_plane_has_ccs (dev_priv, pipe,PLANE_SPRITE0 + plane)) modifiers = skl_plane_format_modifiers_ccs;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 4/6 drm/i915: Add NV12 support to intel_framebuffer_init
In reply to Vidya SrinivasFrom: Chandra Konduru <[email protected]>
This patch adds NV12 as supported format
to intel_framebuffer_init and performs various checks.
v2:
-Fix an issue in checks added (Chandra Konduru)
v3: rebased (me)
v4: Review comments by Ville addressed
Added platform check for NV12 in intel_framebuffer_init Removed offset checks for NV12 case
v5: Addressed review comments by Clinton A Taylor
This NV12 support only correctly works on SKL.
Plane color space conversion is different on GLK and later platforms causing the colors to display incorrectly.
Ville's plane color space property patch series
in review will fix this issue.
- Restricted the NV12 case in intel_framebuffer_init to SKL and BXT only.
v6: Rebased (me)
v7: Addressed review comments by Ville
Restricting the NV12 to BXT for now.
v8: Rebased (me)
Restricting the NV12 changes to BXT and KBL for now.
v9: Rebased (me)
v10: NV12 supported by all GEN >= 9.
Making this change in intel_framebuffer_init. This is part of addressing Maarten's review comments. Comment under v8 no longer applicable
v11: Addressed review comments from Shashank Sharma
v12: Adding Reviewed By from Shashank Sharma
v13: Addressed review comments from Juha-Pekka Heikkila "NV12 not to be supported by SKL"
v14: Addressed review comments from Maarten. Add checks for fb width height for NV12 and fail the fb creation if check fails. Added reviewed by from Juha-Pekka Heikkila
v15: Rebased the series
v16: Setting the minimum value during fb creating to 16 as per Bspec for NV12. Earlier minimum was expected to be > 16. Now changed it to >=16.
v17: Adding restriction to framebuffer_init - the fb width and height should be a multiplier of 4
v18: Added RB from Maarten. Included Maarten's review comments Dont allow CCS formats for fb creation of NV12
Credits-to: Maarten Lankhorst <[email protected]>
--- drivers/gpu/drm/i915/intel_display.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+)
drivers/gpu/drm/i915/intel_display.c +21 -0
@@ -14261,6 +14261,19 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb, goto err; }break ; +case DRM_FORMAT_NV12 : +if ((mode_cmd->modifier[0 ] ==I915_FORMAT_MOD_Y_TILED_CCS ) || + (mode_cmd->modifier[0 ] == I915_FORMAT_MOD_Yf_TILED_CCS)) { +DRM_DEBUG_KMS ("RC not to be enabled with NV12\n" ); + goto err; + } +if (INTEL_GEN (dev_priv) <9 ||IS_SKYLAKE (dev_priv)) { +DRM_DEBUG_KMS ("unsupported pixel format: %s\n" , +drm_get_format_name (mode_cmd->pixel_format, + &format_name)); + goto err; + } +break ;default :DRM_DEBUG_KMS ("unsupported pixel format: %s\n" ,drm_get_format_name (mode_cmd->pixel_format, &format_name));
@@ -14273,6 +14286,14 @@ static int intel_framebuffer_init(struct intel_framebuffer *intel_fb,drm_helper_mode_fill_fb_struct (&dev_priv->drm, fb, mode_cmd); +if (fb->format->format ==DRM_FORMAT_NV12 && + (fb->width <SKL_MIN_YUV_420_SRC_W || + fb->height <SKL_MIN_YUV_420_SRC_H || + (fb->width %4 ) !=0 || (fb->height %4 ) !=0 )) { +DRM_DEBUG_KMS ("src dimensions not correct for NV12\n" ); +return -EINVAL ; + } +for (i =0 ; i < fb->format->num_planes; i++) {u32 stride_alignment;
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 5/6 drm/i915: Enable Display WA 0528
In reply to Vidya SrinivasPossible hang with NV12 plane surface formats.
WA: When the plane source pixel format is NV12, the CHICKEN_PIPESL_* register bit 22 must be set to 1 and the render decompression must not be enabled on any of the planes in that pipe.
v2: removed unnecessary POSTING_READ
v3: Added RB from Maarten
Credits-to: Maarten Lankhorst <[email protected]>
--- drivers/gpu/drm/i915/intel_display.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/intel_display.c +18 -2
@@ -505,6 +505,18 @@ static const struct intel_limit intel_limits_bxt = { };static void +skl_wa_528 (struct drm_i915_private *dev_priv,int pipe,bool enable) +{ +if (IS_SKYLAKE (dev_priv)) +return ; + +if (enable) +I915_WRITE (CHICKEN_PIPESL_1 (pipe),HSW_FBCQ_DIS ); +else +I915_WRITE (CHICKEN_PIPESL_1 (pipe),0 ); +} + +static void skl_wa_clkgate (struct drm_i915_private *dev_priv,int pipe,bool enable) {if (IS_SKYLAKE (dev_priv))
@@ -5202,8 +5214,10 @@ static void intel_post_plane_update(struct intel_crtc_state *old_crtc_state)/* Display WA 827 */ if (needs_nv12_wa (dev_priv, old_crtc_state) && - !needs_nv12_wa (dev_priv, pipe_config)) + !needs_nv12_wa (dev_priv, pipe_config)) {skl_wa_clkgate (dev_priv, crtc->pipe, false); +skl_wa_528 (dev_priv, crtc->pipe, false); + } } static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,
@@ -5240,8 +5254,10 @@ static void intel_pre_plane_update(struct intel_crtc_state *old_crtc_state,/* Display WA 827 */ if (!needs_nv12_wa (dev_priv, old_crtc_state) && -needs_nv12_wa (dev_priv, pipe_config)) +needs_nv12_wa (dev_priv, pipe_config)) {skl_wa_clkgate (dev_priv, crtc->pipe, true); +skl_wa_528 (dev_priv, crtc->pipe, true); + }/* * Vblank time updates from the shadow to live plane control register
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v4 6/6 drm/i915: Add skl_check_nv12_surface for NV12
In reply to Vidya SrinivasFrom: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to skl_check_nv12_surface
--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)
drivers/gpu/drm/i915/intel_display.c +39 -0
@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{ +int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + } + +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) { +DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + } + + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ; + +return 0 ; +} +static int skl_check_nv12_aux_surface (struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb;
@@ -3201,6 +3237,9 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,* the main surface setup depends on it. */ if (fb->format->format ==DRM_FORMAT_NV12 ) { + ret =skl_check_nv12_surface (crtc_state, plane_state); +if (ret) +return ret; ret =skl_check_nv12_aux_surface (plane_state);if (ret)return ret;
drivers/gpu/drm/i915/intel_sprite.c +11 -4
@@ -1035,10 +1035,17 @@ intel_check_sprite_plane(struct intel_plane *plane,return vscale; } -/* Make the source viewport size an exact multiple of the scaling factors. */ -drm_rect_adjust_size (src, -drm_rect_width (dst) * hscale -drm_rect_width (src), -drm_rect_height (dst) * vscale -drm_rect_height (src)); +if (fb->format->format !=DRM_FORMAT_NV12 ) { +/* +* Make the source viewport size +* an exact multiple of the scaling factors +*/ +drm_rect_adjust_size (src, + (drm_rect_width (dst) * hscale - +drm_rect_width (src)), + (drm_rect_height (dst) * vscale - +drm_rect_height (src))); + }drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , state->base.rotation);
Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 10 lines · Vidya Srinivas
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surface
The patch looks good to me.
Quoted 118 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>---
drivers/gpu/drm/i915/intel_display.c | 39
++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++----2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, return 0; }drivers/gpu/drm/i915/intel_display.c +5
-0+static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, + struct intel_plane_state *plane_state) +{ + int crtc_x2 = plane_state->base.crtc_x + plane_state-Quoted 1 line
base.crtc_w;
drivers/gpu/drm/i915/intel_display.c +1
-0+ int crtc_y2 = plane_state->base.crtc_y + plane_state-Quoted 1 line
base.crtc_h;
drivers/gpu/drm/i915/intel_display.c +6
-0+ +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >> 16) % 4) != 0 || + ((plane_state->base.src_w >> 16) % 4) != 0 || + ((plane_state->base.src_h >> 16) % 4) != 0) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
drivers/gpu/drm/i915/intel_display.c +4
-0+return -EINVAL ; + } + +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */
drivers/gpu/drm/i915/intel_display.c +1
-0+ if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state-Quoted 1 line
pipe_src_w% 4) ||drivers/gpu/drm/i915/intel_display.c +1
-0+ (crtc_y2 > crtc_state->pipe_src_h && crtc_state-Quoted 1 line
pipe_src_h% 4)) {drivers/gpu/drm/i915/intel_display.c +1
-0+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to%u,%u\n",
drivers/gpu/drm/i915/intel_display.c +2
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state-Quoted 1 line
pipe_src_h);drivers/gpu/drm/i915/intel_display.c +5
-0+return -EINVAL ; + } + + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +4
-0+ +return 0 ; +} +static int
skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
{
const structdrm_framebuffer*fb =plane_state->base.fb;drivers/gpu/drm/i915/intel_display.c +3
-0@@ -3201,6 +3237,9 @@ int skl_check_plane_surface(const structintel_crtc_state *crtc_state, * the main surface setup depends on it. */ if (fb->format->format == DRM_FORMAT_NV12) { + ret =skl_check_nv12_surface (crtc_state, plane_state); +if (ret) +return ret; ret = skl_check_nv12_aux_surface(plane_state);if (ret)
return ret;drivers/gpu/drm/i915/intel_sprite.c +0
-0@@ -1035,10 +1035,17 @@ intel_check_sprite_plane(struct intel_plane *plane, return vscale; }drivers/gpu/drm/i915/intel_sprite.c +0
-1-/* Make the source viewport size an exact multiple of the scaling factors. */
drivers/gpu/drm/i915/intel_sprite.c +0
-2- drm_rect_adjust_size(src, - drm_rect_width(dst) * hscale -
drm_rect_width(src),drivers/gpu/drm/i915/intel_sprite.c +0
-1- drm_rect_height(dst) * vscale -
drm_rect_height(src));drivers/gpu/drm/i915/intel_sprite.c +7
-0+if (fb->format->format !=DRM_FORMAT_NV12 ) { +/* +* Make the source viewport size +* an exact multiple of the scaling factors +*/ + drm_rect_adjust_size(src, + (drm_rect_width(dst) *hscale -
drivers/gpu/drm/i915/intel_sprite.c +2
-0+ drm_rect_width(src)), + (drm_rect_height(dst) *vscale -
drivers/gpu/drm/i915/intel_sprite.c +1
-0+ drm_rect_height(src)));
drivers/gpu/drm/i915/intel_sprite.c +1
-0+ }
drm_rect_rotate_inv(src,fb->width<< 16,fb->height<< 16,
state->base.rotation);
Signature · 6 lines
Mika Kahola - Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 17 lines
-----Original Message-----
From: Kahola, Mika
Sent: Wednesday, April 18, 2018 5:39 PM
To: Srinivas, Vidya <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH v4 6/6] drm/i915: Addskl_check_nv12_surfacefor NV12Quoted 6 lines · Vidya Srinivas
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.
Quoted 7 lines
Quoted 4 lines
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceThe patch looks good to me.
Reviewed-by Mika Kahola <[email protected]>
Thank you. Will add the RB in next push.
Regards
Vidya
Quoted 116 lines
Quoted 67 lines
Signed-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>---
drivers/gpu/drm/i915/intel_display.c | 39
++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++----2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +11
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, return 0; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, + struct intel_plane_state *plane_state) { +int crtc_x2 = plane_state->base.crtc_x + plane_state- >base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state- >base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >> 16) % 4) != 0 || + ((plane_state->base.src_w >> 16) % 4) != 0 || + ((plane_state->base.src_h >> 16) % 4) != 0) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
drivers/gpu/drm/i915/intel_display.c +4
-0+return -EINVAL ; + } + +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */
drivers/gpu/drm/i915/intel_display.c +1
-0+ if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state-Quoted 1 line
pipe_src_w% 4) ||drivers/gpu/drm/i915/intel_display.c +1
-0+ (crtc_y2 > crtc_state->pipe_src_h && crtc_state-Quoted 1 line
pipe_src_h% 4)) {drivers/gpu/drm/i915/intel_display.c +1
-0+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to%u,%u\n",
drivers/gpu/drm/i915/intel_display.c +2
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state-Quoted 1 line
pipe_src_h);drivers/gpu/drm/i915/intel_display.c +5
-0+return -EINVAL ; + } + + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 )<< 18;
drivers/gpu/drm/i915/intel_display.c +4
-0+ +return 0 ; +} +Quoted 4 lines
static int
skl_check_nv12_aux_surface(struct intel_plane_state *plane_state)
{
const structdrm_framebuffer*fb =plane_state->base.fb; @@ -3201,6
Quoted 44 lines
+3237,9 @@ int skl_check_plane_surface(const struct
intel_crtc_state*crtc_state,
* the main surface setup depends on it.
*/
if (fb->format->format==DRM_FORMAT_NV12) {drivers/gpu/drm/i915/intel_display.c +1
-0+ ret = skl_check_nv12_surface(crtc_state,
plane_state);drivers/gpu/drm/i915/intel_display.c +2
-0+if (ret) +return ret;ret =
skl_check_nv12_aux_surface(plane_state); if (ret)
return ret;drivers/gpu/drm/i915/intel_sprite.c +0
-1@@ -1035,10 +1035,17 @@ intel_check_sprite_plane(struct intel_plane *plane, return vscale; } -/* Make the source viewport size an exact multiple of the scaling factors. */
drivers/gpu/drm/i915/intel_sprite.c +0
-2- drm_rect_adjust_size(src, - drm_rect_width(dst) * hscale -
drm_rect_width(src),drivers/gpu/drm/i915/intel_sprite.c +0
-1- drm_rect_height(dst) * vscale -
drm_rect_height(src));drivers/gpu/drm/i915/intel_sprite.c +7
-0+if (fb->format->format !=DRM_FORMAT_NV12 ) { +/* +* Make the source viewport size +* an exact multiple of the scaling factors +*/ + drm_rect_adjust_size(src, + (drm_rect_width(dst) *hscale -
drivers/gpu/drm/i915/intel_sprite.c +2
-0+ drm_rect_width(src)), + (drm_rect_height(dst) *vscale -
drivers/gpu/drm/i915/intel_sprite.c +1
-0+ drm_rect_height(src)));
drivers/gpu/drm/i915/intel_sprite.c +1
-0+ }
Quoted 4 lines
Quoted 2 lines
drm_rect_rotate_inv(src, fb->width << 16, fb->height << 16, state->base.rotation);--
Mika Kahola - Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
In reply to Vidya SrinivasQuoted 30 lines · Vidya Srinivas
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +4
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + }
I don't really see why we should check these. The clipped coordinates are what matters.
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3143
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) { +DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }
Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3152
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;
Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.
Quoted 50 lines
drivers/gpu/drm/i915/intel_display.c +7
-0+ +return 0 ; +} +static int skl_check_nv12_aux_surface (struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb;@@ -3201,6 +3237,9 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,* the main surface setup depends on it. */ if (fb->format->format ==DRM_FORMAT_NV12 ) { + ret =skl_check_nv12_surface (crtc_state, plane_state); +if (ret) +return ret; ret =skl_check_nv12_aux_surface (plane_state);if (ret)return ret;drivers/gpu/drm/i915/intel_sprite.c +11
-4@@ -1035,10 +1035,17 @@ intel_check_sprite_plane(struct intel_plane *plane,return vscale; } -/* Make the source viewport size an exact multiple of the scaling factors. */ -drm_rect_adjust_size (src, -drm_rect_width (dst) * hscale -drm_rect_width (src), -drm_rect_height (dst) * vscale -drm_rect_height (src)); +if (fb->format->format !=DRM_FORMAT_NV12 ) { +/* +* Make the source viewport size +* an exact multiple of the scaling factors +*/ +drm_rect_adjust_size (src, + (drm_rect_width (dst) * hscale - +drm_rect_width (src)), + (drm_rect_height (dst) * vscale - +drm_rect_height (src))); + }drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , state->base.rotation);Signature · 6 lines
2.7.4 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 27 lines · Vidya Srinivas
Quoted 26 lines
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; }
Quoted 16 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they have different requirements.
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) {
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3143
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5
-0+DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Unfortunately for the other formats we already have an existing userspace (X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3152
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
Quoted 3 lines
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 45 lines · Maarten Lankhorst
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 27 lines · Vidya Srinivas
Quoted 26 lines
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; }Quoted 16 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
Quoted 6 lines
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they have different requirements.
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Quoted 14 lines
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3143
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) { +DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Quoted 3 lines
Unfortunately for the other formats we already have an existing userspace (X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.
We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 14 lines
Quoted 14 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3152
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
Quoted 7 lines
Quoted 3 lines
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc.
Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 248 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Thursday, April 19, 2018 12:06 AM
To: Maarten Lankhorst <[email protected]>
Cc Srinivas, Vidya <[email protected]>; intel-Subject: Re: [Intel-gfx] [PATCH v4 6/6] drm/i915: Add
skl_check_nv12_surfacefor NV12Quoted 48 lines · Maarten Lankhorst
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 45 lines · Vidya Srinivas
Quoted 44 lines
From: Maarten Lankhorst <[email protected]<mailto:[email protected]>>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly.
Without this, pipe fifo underruns are seen on APL/KBL.
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst<[email protected]<mailto:[email protected]>>
---
drivers/gpu/drm/i915/intel_display.c | 39++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++----2 files changed, 50 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_display.cQuoted 7 lines
Quoted 7 lines
Review static int skl_check_main_surface(const
Quoted 7 lines
index 925402e..b8dbaca 100644
---
a/drivers/gpu/drm/i915/intel_display.c+++
b/drivers/gpu/drm/i915/intel_display.c(quoted diff) +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(conststruct
intel_crtc_state*crtc_state,Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
(quoted diff) +8
-0return 0; } +static int +skl_check_nv12_surface(const struct intel_crtc_state *crtc_state, + struct intel_plane_state *plane_state) { + int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; + int crtc_y2 = plane_state->base.crtc_y + +plane_state->base.crtc_h; + + if (((plane_state->base.src_x >> 16) % 4) != 0 ||Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +4
-0+ ((plane_state->base.src_y >> 16) % 4) != 0 || + ((plane_state->base.src_w >> 16) % 4) != 0 || + ((plane_state->base.src_h >> 16) % 4) != 0) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
Quoted 10 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+return -EINVAL ; + }I don't really see why we should check these. The clipped
coordinates are what matters.
Quoted 5 lines
To propagate our limits to the userspace. I think we should do it for
all formats, but NV12 is the first YUV format we have tests for. If we
could we should do something similar for the other YUV formats, but they
have different requirements.
Quoted 5 lines
In case of NV12 we don't have existing userspace, there will be
nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here.
We need to come up with some proper rules for this stuff.
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +3
-0+ + /* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ + if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4) ||
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ (
crtc_y2>crtc_state->pipe_src_h&&crtc_state->pipe_src_h% 4)){
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to
%u,%u\n",
Quoted 16 lines
Quoted 6 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ;Quoted 7 lines
Quoted 1 line
+ }
Why should we care? The current code already plays it fast and loose
and allows the dst rectangle to shrink to accomodate the hw limits.
If we want to change that we should change it universally.
Quoted 7 lines
Unfortunately for the other formats we already have an existing
userspace
(X.org) that doesn't perform any validation. We can't change it for
that, but we can prevent future mistakes.
We should do it uniformly. Not per-format. That will make the code
unmaintainable real quick.
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +3
-0+ + plane_state->base.src.x1 = + DIV_ROUND_CLOSEST(plane_state->base.src.x1, 1 << 18) <<18;
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ plane_state->base.src.x2 = + DIV_ROUND_CLOSEST(plane_state->base.src.x2, 1 << 18) <<18;
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ plane_state->base.src.y1 = + DIV_ROUND_CLOSEST(plane_state->base.src.y1, 1 << 18) <<18;
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ plane_state->base.src.y2 = + DIV_ROUND_CLOSEST(plane_state->base.src.y2, 1 << 18) <<18;
Quoted 16 lines
Quoted 8 lines
Since this can now increase the size of the source rectangle our
scaling factor checks are no longer 100% valid. We might end up with
a scaling factor that is too high.
Quoted 5 lines
I don't really like any of these "let's make NV12 behave special"
tricks. We should make the code behave the same way for all pixel
formats instead of adding format specific hacks.
Quoted 5 lines
This is not nivalid because we restrict the original src coordinates
to be a multiple of 4, you can only clip to something smaller, not to
something bigger. :)
Quoted 7 lines
The clipped coordinates can be whatever thanks to scaling/etc.
Also why are we trying to make everything a multiple of four? I don't
remember any hw restrictions like that.
Hi
As per WA1106, Display corruption/color shift observed when using NV12 with 270 rotation or 90 rotation + horizontal flip.
WA: NV12 with 270 rotation or 90 rotation + horizontal flip requires the programmed plane height to be a multiple of 4.
As per experiments on APL and KBL, when we don't keep them multiple of 4, we see fifo underruns.
Regards
Vidya
Quoted 7 lines
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 258 lines · Vidya
Quoted 248 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Thursday, April 19, 2018 12:06 AM
To: Maarten Lankhorst <[email protected]>
Cc Srinivas, Vidya <[email protected]>; intel-Subject: Re: [Intel-gfx] [PATCH v4 6/6] drm/i915: Add
skl_check_nv12_surfacefor NV12Quoted 48 lines · Maarten Lankhorst
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 45 lines · Vidya Srinivas
Quoted 44 lines
From: Maarten Lankhorst <[email protected]<mailto:[email protected]>>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly.
Without this, pipe fifo underruns are seen on APL/KBL.
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst<[email protected]<mailto:[email protected]>>
---
drivers/gpu/drm/i915/intel_display.c | 39++++++++++++++++++++++++++++++++++++
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++----2 files changed, 50 insertions(+), 4 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_display.cQuoted 7 lines
Quoted 7 lines
Review static int skl_check_main_surface(const
Quoted 7 lines
index 925402e..b8dbaca 100644
---
a/drivers/gpu/drm/i915/intel_display.c+++
b/drivers/gpu/drm/i915/intel_display.c(quoted diff) +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(conststruct
intel_crtc_state*crtc_state,Quoted 22 lines
Quoted 21 lines
Quoted 21 lines
(quoted diff) +8
-0return 0; } +static int +skl_check_nv12_surface(const struct intel_crtc_state *crtc_state, + struct intel_plane_state *plane_state) { + int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; + int crtc_y2 = plane_state->base.crtc_y + +plane_state->base.crtc_h; + + if (((plane_state->base.src_x >> 16) % 4) != 0 ||Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +4
-0+ ((plane_state->base.src_y >> 16) % 4) != 0 || + ((plane_state->base.src_w >> 16) % 4) != 0 || + ((plane_state->base.src_h >> 16) % 4) != 0) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
Quoted 10 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+return -EINVAL ; + }I don't really see why we should check these. The clipped
coordinates are what matters.
Quoted 5 lines
To propagate our limits to the userspace. I think we should do it for
all formats, but NV12 is the first YUV format we have tests for. If we
could we should do something similar for the other YUV formats, but they
have different requirements.
Quoted 5 lines
In case of NV12 we don't have existing userspace, there will be
nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here.
We need to come up with some proper rules for this stuff.
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +3
-0+ + /* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ + if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4) ||
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ (
crtc_y2>crtc_state->pipe_src_h&&crtc_state->pipe_src_h% 4)){
Quoted 1 line
Quoted 1 line
Quoted 1 line
+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to
%u,%u\n",
Quoted 16 lines
Quoted 6 lines
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ;Quoted 7 lines
Quoted 1 line
+ }
Why should we care? The current code already plays it fast and loose
and allows the dst rectangle to shrink to accomodate the hw limits.
If we want to change that we should change it universally.
Quoted 7 lines
Unfortunately for the other formats we already have an existing
userspace
(X.org) that doesn't perform any validation. We can't change it for
that, but we can prevent future mistakes.
We should do it uniformly. Not per-format. That will make the code
unmaintainable real quick.
Quoted 7 lines
Quoted 7 lines
Review
Quoted 7 lines
(quoted diff) +3
-0+ + plane_state->base.src.x1 = + DIV_ROUND_CLOSEST(plane_state->base.src.x1, 1 << 18) <<18;
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ plane_state->base.src.x2 = + DIV_ROUND_CLOSEST(plane_state->base.src.x2, 1 << 18) <<18;
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ plane_state->base.src.y1 = + DIV_ROUND_CLOSEST(plane_state->base.src.y1, 1 << 18) <<18;
Quoted 3 lines
Quoted 3 lines
Review
Quoted 3 lines
(quoted diff) +2
-0+ plane_state->base.src.y2 = + DIV_ROUND_CLOSEST(plane_state->base.src.y2, 1 << 18) <<18;
Quoted 16 lines
Quoted 8 lines
Since this can now increase the size of the source rectangle our
scaling factor checks are no longer 100% valid. We might end up with
a scaling factor that is too high.
Quoted 5 lines
I don't really like any of these "let's make NV12 behave special"
tricks. We should make the code behave the same way for all pixel
formats instead of adding format specific hacks.
Quoted 5 lines
This is not nivalid because we restrict the original src coordinates
to be a multiple of 4, you can only clip to something smaller, not to
something bigger. :)
Quoted 7 lines
The clipped coordinates can be whatever thanks to scaling/etc.
Also why are we trying to make everything a multiple of four? I don't
remember any hw restrictions like that.
Quoted 6 lines
Hi
As per WA1106, Display corruption/color shift observed when using NV12 with 270 rotation or 90 rotation + horizontal flip.
WA: NV12 with 270 rotation or 90 rotation + horizontal flip requires the programmed plane height to be a multiple of 4.
Does plane height here mean src height or dst height?
Either way I don't see why we aren't just checking for the right thing instead of trying to mandate a four pixel alignment everywhere.
Quoted 20 lines
As per experiments on APL and KBL, when we don't keep them multiple of 4, we see fifo underruns.
Regards
Vidya
Quoted 7 lines
--
Ville Syrjälä
Intel
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Op 19-04-18 om 13:22 schreef Ville Syrjälä:
Quoted 115 lines · Vidya
Quoted 114 lines
Quoted 103 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Thursday, April 19, 2018 12:06 AM
To: Maarten Lankhorst <[email protected]>
Cc: Srinivas, Vidya <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH v4 6/6] drm/i915: Addskl_check_nv12_surfacefor NV12Quoted 15 lines · Maarten Lankhorst
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 14 lines · Vidya Srinivas
Quoted 13 lines
From: Maarten Lankhorst <[email protected]<mailto:[email protected]>> We skip src trunction/adjustments for
NV12 case and handle the sizes directly.
Without this, pipe fifo underruns are seen on APL/KBL.
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 toskl_check_nv12_surface
Signed-off-by: Maarten Lankhorst <[email protected]<mailto:[email protected]>>--- drivers/gpu/drm/i915/intel_display.c | 39++++++++++++++++++++++++++++++++++++
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const
Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(conststruct
intel_crtc_state*crtc_state,Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +4
-0return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) { +int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w;Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3131
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +8
-0+int crtc_y2 = plane_state->base.crtc_y + +plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
Quoted 7 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3133
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they
have different requirements.
Quoted 2 lines
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3136
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ + if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4) ||
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3137
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1
-0+ (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h % 4)){
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3138
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1
-0+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to%u,%u\n",
Quoted 11 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3142
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Unfortunately for the other formats we already have an existing userspace
(X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3145
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ + plane_state->base.src.x1 = + DIV_ROUND_CLOSEST(plane_state->base.src.x1, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3147
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.x2 = + DIV_ROUND_CLOSEST(plane_state->base.src.x2, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3149
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y1 = + DIV_ROUND_CLOSEST(plane_state->base.src.y1, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3151
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y2 = + DIV_ROUND_CLOSEST(plane_state->base.src.y2, 1 << 18) <<18;
Quoted 6 lines
Quoted 6 lines
Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.Quoted 6 lines
Quoted 3 lines
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc. Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Hi
Quoted 8 lines
Quoted 3 lines
As per WA1106, Display corruption/color shift observed when using NV12 with 270 rotation or 90 rotation + horizontal flip.
WA: NV12 with 270 rotation or 90 rotation + horizontal flip requires the programmed plane height to be a multiple of 4.
Does plane height here mean src height or dst height?
Either way I don't see why we aren't just checking for the right thing instead of trying to mandate a four pixel alignment everywhere.
Agreed, what about the below diff, would this be acceptable to you? I deliberately ignore the last 16 bits as that is what we currently do anyway for all formats.
drivers/gpu/drm/i915/intel_display.c +28 -0
@@ -3090,6 +3090,31 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{ +/* Display WA #1106 */ +if (plane_state->base.rotation != (DRM_MODE_REFLECT_X |DRM_MODE_ROTATE_90 ) && + plane_state->base.rotation !=DRM_MODE_ROTATE_270 ) +return 0 ; + +/* Because x/y are src coordinates will be rotated, we look at x/width here. */ +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src x/w must be multiple of 4 for rotated NV12\n" ); +return -EINVAL ; + } + +/* And round y here */ + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ; + +return 0 ; +} +static int skl_check_nv12_aux_surface (struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb;
@@ -3173,6 +3198,9 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,* the main surface setup depends on it. */ if (fb->format->format ==DRM_FORMAT_NV12 ) { + ret =skl_check_nv12_surface (crtc_state, plane_state); +if (ret) +return ret; ret =skl_check_nv12_aux_surface (plane_state);if (ret)return ret;
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 132 lines · Maarten Lankhorst
Op 19-04-18 om 13:22 schreef Ville Syrjälä:
Quoted 115 lines · Vidya
Quoted 114 lines
Quoted 103 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Thursday, April 19, 2018 12:06 AM
To: Maarten Lankhorst <[email protected]>
Cc: Srinivas, Vidya <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH v4 6/6] drm/i915: Addskl_check_nv12_surfacefor NV12Quoted 15 lines · Maarten Lankhorst
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 14 lines · Vidya Srinivas
Quoted 13 lines
From: Maarten Lankhorst <[email protected]<mailto:[email protected]>> We skip src trunction/adjustments for
NV12 case and handle the sizes directly.
Without this, pipe fifo underruns are seen on APL/KBL.
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 toskl_check_nv12_surface
Signed-off-by: Maarten Lankhorst <[email protected]<mailto:[email protected]>>--- drivers/gpu/drm/i915/intel_display.c | 39++++++++++++++++++++++++++++++++++++
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const
Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(conststruct
intel_crtc_state*crtc_state,Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +4
-0return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) { +int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w;Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3131
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +8
-0+int crtc_y2 = plane_state->base.crtc_y + +plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
Quoted 7 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3133
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they
have different requirements.
Quoted 2 lines
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3136
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ + if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4) ||
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3137
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1
-0+ (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h % 4)){
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3138
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1
-0+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to%u,%u\n",
Quoted 11 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3107
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Unfortunately for the other formats we already have an existing userspace
(X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3145
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ + plane_state->base.src.x1 = + DIV_ROUND_CLOSEST(plane_state->base.src.x1, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3147
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.x2 = + DIV_ROUND_CLOSEST(plane_state->base.src.x2, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3149
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y1 = + DIV_ROUND_CLOSEST(plane_state->base.src.y1, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3151
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y2 = + DIV_ROUND_CLOSEST(plane_state->base.src.y2, 1 << 18) <<18;
Quoted 6 lines
Quoted 6 lines
Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.Quoted 6 lines
Quoted 3 lines
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc. Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Hi
Quoted 8 lines
Quoted 3 lines
As per WA1106, Display corruption/color shift observed when using NV12 with 270 rotation or 90 rotation + horizontal flip.
WA: NV12 with 270 rotation or 90 rotation + horizontal flip requires the programmed plane height to be a multiple of 4.
Does plane height here mean src height or dst height?
Either way I don't see why we aren't just checking for the right thing instead of trying to mandate a four pixel alignment everywhere.
Agreed, what about the below diff, would this be acceptable to you? I deliberately ignore the last 16 bits as that is what we currently do anyway for all formats.
drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3090,6 +3090,31 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ;
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3100
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +8
-0} +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{ +/* Display WA #1106 */ +if (plane_state->base.rotation != (DRM_MODE_REFLECT_X |DRM_MODE_ROTATE_90 ) && + plane_state->base.rotation !=DRM_MODE_ROTATE_270 ) +return 0 ;
Hmm. I wonder if that's what the spec actually means. The HSDs only talk about 270 degree rotation. So I guess this interpretation could be correct.
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3113
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +13
-0+ +/* Because x/y are src coordinates will be rotated, we look at x/width here. */ +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src x/w must be multiple of 4 for rotated NV12\n" ); +return -EINVAL ; + } + +/* And round y here */ + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;
Why not just a simple
if (drm_rect_height(src) >> 16 % 4 != 0)
return -EINVAL;
?
Quoted 17 lines
drivers/gpu/drm/i915/intel_display.c +7
-0+ +return 0 ; +} +static int skl_check_nv12_aux_surface (struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb;@@ -3173,6 +3198,9 @@ int skl_check_plane_surface(const struct intel_crtc_state *crtc_state,* the main surface setup depends on it. */ if (fb->format->format ==DRM_FORMAT_NV12 ) { + ret =skl_check_nv12_surface (crtc_state, plane_state); +if (ret) +return ret; ret =skl_check_nv12_aux_surface (plane_state);if (ret)return ret;
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Op 19-04-18 om 13:50 schreef Ville Syrjälä:
Quoted 160 lines · Maarten Lankhorst
Quoted 130 lines
Op 19-04-18 om 13:22 schreef Ville Syrjälä:
Quoted 113 lines · Vidya
Quoted 112 lines
Quoted 102 lines
-----Original Message-----
From: Ville Syrjälä [mailto:[email protected]]
Sent: Thursday, April 19, 2018 12:06 AM
To: Maarten Lankhorst <[email protected]>
Cc: Srinivas, Vidya <[email protected]>; intel- [email protected]
Subject: Re: [Intel-gfx] [PATCH v4 6/6] drm/i915: Addskl_check_nv12_surfacefor NV12Quoted 15 lines · Maarten Lankhorst
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 14 lines · Vidya Srinivas
Quoted 13 lines
From: Maarten Lankhorst <[email protected]<mailto:[email protected]>> We skip src trunction/adjustments for
NV12 case and handle the sizes directly.
Without this, pipe fifo underruns are seen on APL/KBL.
v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 toskl_check_nv12_surface
Signed-off-by: Maarten Lankhorst <[email protected]<mailto:[email protected]>>--- drivers/gpu/drm/i915/intel_display.c | 39++++++++++++++++++++++++++++++++++++
Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const
Quoted 8 lines
drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(conststruct
intel_crtc_state*crtc_state,Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
drivers/gpu/drm/i915/intel_display.c +4
-0return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) { +int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w;Quoted 8 lines
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3131
Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c +8
-0+int crtc_y2 = plane_state->base.crtc_y + +plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { + DRM_DEBUG_KMS("src coords must be multiple of 4 forNV12\n");
Quoted 7 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3133
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they
have different requirements.
Quoted 2 lines
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3136
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ + if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4) ||
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3137
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1
-0+ (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h % 4)){
Quoted 1 line
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3138
Quoted 1 line
drivers/gpu/drm/i915/intel_display.c +1
-0+ DRM_DEBUG_KMS("It's not possible to clip %u,%u to%u,%u\n",
Quoted 11 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3107
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+ crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Unfortunately for the other formats we already have an existing userspace
(X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 3 lines
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3145
Quoted 3 lines
drivers/gpu/drm/i915/intel_display.c +3
-0+ + plane_state->base.src.x1 = + DIV_ROUND_CLOSEST(plane_state->base.src.x1, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3147
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.x2 = + DIV_ROUND_CLOSEST(plane_state->base.src.x2, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3149
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y1 = + DIV_ROUND_CLOSEST(plane_state->base.src.y1, 1 << 18) <<18;
Quoted 2 lines
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const · line 3151
Quoted 2 lines
drivers/gpu/drm/i915/intel_display.c +2
-0+ plane_state->base.src.y2 = + DIV_ROUND_CLOSEST(plane_state->base.src.y2, 1 << 18) <<18;
Quoted 6 lines
Quoted 6 lines
Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.Quoted 6 lines
Quoted 3 lines
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc. Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Hi
Quoted 8 lines
Quoted 3 lines
As per WA1106, Display corruption/color shift observed when using NV12 with 270 rotation or 90 rotation + horizontal flip.
WA: NV12 with 270 rotation or 90 rotation + horizontal flip requires the programmed plane height to be a multiple of 4.
Does plane height here mean src height or dst height?
Either way I don't see why we aren't just checking for the right thing instead of trying to mandate a four pixel alignment everywhere.
Agreed, what about the below diff, would this be acceptable to you? I deliberately ignore the last 16 bits as that is what we currently do anyway for all formats.
drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3090,6 +3090,31 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ;drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3100
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +8
-0} +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{ +/* Display WA #1106 */ +if (plane_state->base.rotation != (DRM_MODE_REFLECT_X |DRM_MODE_ROTATE_90 ) && + plane_state->base.rotation !=DRM_MODE_ROTATE_270 ) +return 0 ;Hmm. I wonder if that's what the spec actually means. The HSDs only talk about 270 degree rotation. So I guess this interpretation could be correct.
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3113
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c +13
-0+ +/* Because x/y are src coordinates will be rotated, we look at x/width here. */ +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src x/w must be multiple of 4 for rotated NV12\n" ); +return -EINVAL ; + } + +/* And round y here */ + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;Why not just a simple
Quoted 3 lines
if (
drm_rect_height(src)>> 16 % 4 != 0)return -EINVAL;
So lets do that, but we have to fix the rounding errors in i915 to make it useful:
upscaling 16x16 to 2560x1440:
(kms_plane_scaling:1172) igt_kms-DEBUG: plane A.1: Setting property "SRC_W" to 0x100000/1048576 (kms_plane_scaling:1172) igt_kms-DEBUG: plane A.1: Setting property "SRC_H" to 0x100000/1048576 (kms_plane_scaling:1172) igt_kms-DEBUG: plane A.1: Setting property "CRTC_X" to 0x0/0 (kms_plane_scaling:1172) igt_kms-DEBUG: plane A.1: Setting property "CRTC_Y" to 0x0/0 (kms_plane_scaling:1172) igt_kms-DEBUG: plane A.1: Setting property "CRTC_W" to 0xa00/2560 (kms_plane_scaling:1172) igt_kms-DEBUG: plane A.1: Setting property "CRTC_H" to 0x5a0/1440
[ 290.766555] [drm:drm_ioctl [drm]] pid=1172, dev=0xe200, auth=1, DRM_IOCTL_MODE_ATOMIC
...
[ 290.767276] [drm:skl_update_scaler [i915]] NV12: src dimensions not met: 15 < 16
[ 290.767284] [drm:drm_atomic_helper_check_planes [drm_kms_helper]] [PLANE:33:plane 2A] atomic driver check failed [ 290.767422] [drm:drm_ioctl [drm]] pid=1172, ret = -22
If we want to go with that patch, I'll commit it but let the tests fail since rounding is not a NV12 specific error.
~Maarten
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
In reply to Ville SyrjäläOp 18-04-18 om 20:35 schreef Ville Syrjälä:
Quoted 45 lines · Maarten Lankhorst
Quoted 44 lines
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 43 lines · Vidya Srinivas
Quoted 30 lines
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +4
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; } +static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
Quoted 8 lines
Quoted 6 lines
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they have different requirements.
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Would we break anything if we disallow sub-pixel coordinates for i915 globally? It's not like we supported them before, but I'm not sure that change would break anything.
Quoted 30 lines
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) {Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3143
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5
-0+DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Quoted 3 lines
Unfortunately for the other formats we already have an existing userspace (X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.
We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3152
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
Quoted 7 lines
Quoted 6 lines
Quoted 3 lines
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc.
Yes, but it will always be smaller than the original rectangle, so rounding to 4 when the original set of coordinates were a multiple of 4 would never go outside the original boundary.
Quoted 2 lines
Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Well Vidya already replied, it sucks but it's what we have to live with for now. :(
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Quoted 50 lines · Maarten Lankhorst
Op 18-04-18 om 20:35 schreef Ville Syrjälä:
Quoted 49 lines · Maarten Lankhorst
Quoted 48 lines
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 27 lines · Vidya Srinivas
Quoted 26 lines
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; }Quoted 16 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they have different requirements.
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Would we break anything if we disallow sub-pixel coordinates for i915 globally? It's not like we supported them before, but I'm not sure that change would break anything.
Not really I suppose. IIRC the hw did reintroduce partial sub-pixel coordinate support for NV12 specifically. I do wish they'd done it fully for all formats.
Quoted 34 lines
Quoted 34 lines
Quoted 13 lines
Quoted 13 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3143
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) { +DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Quoted 3 lines
Unfortunately for the other formats we already have an existing userspace (X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.
We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3152
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.
Quoted 8 lines
Quoted 4 lines
Quoted 3 lines
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc.
Yes, but it will always be smaller than the original rectangle, so rounding to 4 when the original set of coordinates were a multiple of 4 would never go outside the original boundary.
I was talking about the scaling factor increasing, and potentially exceeding the hardware maximum.
Quoted 5 lines
Quoted 3 lines
Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Well Vidya already replied, it sucks but it's what we have to live with for now. :(
That was just about the plane height. Nothing seems to require making everything a multiple of four.
Signature · 6 lines
Ville Syrjälä Intel _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v4 6/6] drm/i915: Add skl_check_nv12_surface for NV12
Op 19-04-18 om 13:32 schreef Ville Syrjälä:
Quoted 101 lines · Maarten Lankhorst
Quoted 50 lines
Op 18-04-18 om 20:35 schreef Ville Syrjälä:
Quoted 49 lines · Maarten Lankhorst
Quoted 48 lines
Op 18-04-18 om 17:32 schreef Ville Syrjälä:
Quoted 27 lines · Vidya Srinivas
Quoted 26 lines
From: Maarten Lankhorst <[email protected]>
We skip src trunction/adjustments for
NV12 case and handle the sizes directly. Without this, pipe fifo underruns are seen on APL/KBL.v2: For NV12, making the src coordinates multiplier of 4
v3: Moving all the src coords handling code for NV12 to
skl_check_nv12_surfaceSigned-off-by Maarten Lankhorst <[email protected]>Signed-off-by Vidya Srinivas <[email protected]>--- drivers/gpu/drm/i915/intel_display.c | 39 ++++++++++++++++++++++++++++++++++++ drivers/gpu/drm/i915/intel_sprite.c | 15 ++++++++++---- 2 files changed, 50 insertions(+), 4 deletions(-)drivers/gpu/drm/i915/intel_display.c +0
-0@@ -3118,6 +3118,42 @@ static int skl_check_main_surface(const struct intel_crtc_state *crtc_state,return 0 ; }Quoted 16 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+static int +skl_check_nv12_surface (const struct intel_crtc_state *crtc_state, +struct intel_plane_state *plane_state) +{drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3134
Quoted 10 lines
drivers/gpu/drm/i915/intel_display.c +10
-0+int crtc_x2 = plane_state->base.crtc_x + plane_state->base.crtc_w; +int crtc_y2 = plane_state->base.crtc_y + plane_state->base.crtc_h; + +if (((plane_state->base.src_x >>16 ) %4 ) !=0 || + ((plane_state->base.src_y >>16 ) %4 ) !=0 || + ((plane_state->base.src_w >>16 ) %4 ) !=0 || + ((plane_state->base.src_h >>16 ) %4 ) !=0 ) { +DRM_DEBUG_KMS ("src coords must be multiple of 4 for NV12\n" ); +return -EINVAL ; + }I don't really see why we should check these. The clipped coordinates are what matters.
To propagate our limits to the userspace. I think we should do it for all formats, but NV12 is the first YUV format we have tests for. If we could we should do something similar for the other YUV formats, but they have different requirements.
Quoted 6 lines
Quoted 4 lines
Quoted 2 lines
In case of NV12 we don't have existing userspace, there will be nothing that breaks if we enforce limits from the start.
But what about sub-pixel coordinates? You're totally ignoring them here. We need to come up with some proper rules for this stuff.
Would we break anything if we disallow sub-pixel coordinates for i915 globally? It's not like we supported them before, but I'm not sure that change would break anything.
Not really I suppose. IIRC the hw did reintroduce partial sub-pixel coordinate support for NV12 specifically. I do wish they'd done it fully for all formats.
Quoted 33 lines
Quoted 33 lines
Quoted 12 lines
Quoted 4 lines
Quoted 4 lines
drivers/gpu/drm/i915/intel_display.c +4
-0+ +/* Clipping would cause a 1-3 pixel gap at the edge of the screen? */ +if ((crtc_x2 > crtc_state->pipe_src_w && crtc_state->pipe_src_w %4 ) || + (crtc_y2 > crtc_state->pipe_src_h && crtc_state->pipe_src_h %4 )) {Quoted 8 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3143
Quoted 5 lines
drivers/gpu/drm/i915/intel_display.c +5
-0+DRM_DEBUG_KMS ("It's not possible to clip %u,%u to %u,%u\n" , + crtc_x2, crtc_y2, + crtc_state->pipe_src_w, crtc_state->pipe_src_h); +return -EINVAL ; + }Why should we care? The current code already plays it fast and loose and allows the dst rectangle to shrink to accomodate the hw limits. If we want to change that we should change it universally.
Quoted 3 lines
Unfortunately for the other formats we already have an existing userspace (X.org) that doesn't perform any validation. We can't change it for that, but we can prevent future mistakes.
We should do it uniformly. Not per-format. That will make the code unmaintainable real quick.
Quoted 16 lines
Quoted 16 lines
drivers/gpu/drm/i915/intel_display.c static int skl_check_main_surface(const struct intel_crtc_state *crtc_state, · line 3152
Quoted 9 lines
drivers/gpu/drm/i915/intel_display.c +9
-0+ + plane_state->base.src.x1 = +DIV_ROUND_CLOSEST (plane_state->base.src.x1,1 <<18 ) <<18 ; + plane_state->base.src.x2 = +DIV_ROUND_CLOSEST (plane_state->base.src.x2,1 <<18 ) <<18 ; + plane_state->base.src.y1 = +DIV_ROUND_CLOSEST (plane_state->base.src.y1,1 <<18 ) <<18 ; + plane_state->base.src.y2 = +DIV_ROUND_CLOSEST (plane_state->base.src.y2,1 <<18 ) <<18 ;Since this can now increase the size of the source rectangle our scaling factor checks are no longer 100% valid. We might end up with a scaling factor that is too high.
I don't really like any of these "let's make NV12 behave special" tricks. We should make the code behave the same way for all pixel formats instead of adding format specific hacks.
Quoted 7 lines
Quoted 4 lines
Quoted 3 lines
This is not nivalid because we restrict the original src coordinates to be a multiple of 4, you can only clip to something smaller, not to something bigger. :)
The clipped coordinates can be whatever thanks to scaling/etc.
Yes, but it will always be smaller than the original rectangle, so rounding to 4 when the original set of coordinates were a multiple of 4 would never go outside the original boundary.
Quoted 9 lines
I was talking about the scaling factor increasing, and potentially exceeding the hardware maximum.
Quoted 3 lines
Quoted 2 lines
Also why are we trying to make everything a multiple of four? I don't remember any hw restrictions like that.
Well Vidya already replied, it sucks but it's what we have to live with for now. :(
That was just about the plane height. Nothing seems to require making everything a multiple of four.
This was to get rid of FIFO underruns, but the new solution appears to be not enable it on BXT. I can live with that. :)
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for Enable NV12 support (rev2)
In reply to Vidya Srinivas== Series Details ==
== Series Details ==
Series: Enable NV12 support (rev2)
URL : https://patchwork.freedesktop.org/series/41674/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip e7aa87c8fdf6 drm/i915: Enable display workaround 827 for all planes, v2. -:58: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #58: FILE: drivers/gpu/drm/i915/intel_display.c:5148: + if ((INTEL_GEN(dev_priv) == 9 && !IS_GEMINILAKE(dev_priv)) || + IS_CANNONLAKE(dev_priv))
total: 0 errors, 0 warnings, 1 checks, 95 lines checked75716cad6db9 drm/i915: Add NV12 as supported format for primary planec5d7ac7c4cc8 drm/i915: Add NV12 as supported format for sprite planea8ee79b84f5d drm/i915: Add NV12 support to intel_framebuffer_init
-:85: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED_CCS' #85: FILE: drivers/gpu/drm/i915/intel_display.c:14265:
+ if ((mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED_CCS) ||
+ (mode_cmd->modifier[0] == I915_FORMAT_MOD_Yf_TILED_CCS)) {
-:85: CHECK:UNNECESSARY_PARENTHESES: Unnecessary parentheses around 'mode_cmd->modifier[0] == I915_FORMAT_MOD_Yf_TILED_CCS' #85: FILE: drivers/gpu/drm/i915/intel_display.c:14265:
+ if ((mode_cmd->modifier[0] == I915_FORMAT_MOD_Y_TILED_CCS) ||
+ (mode_cmd->modifier[0] == I915_FORMAT_MOD_Yf_TILED_CCS)) {
total: 0 errors, 0 warnings, 2 checks, 33 lines checked 7cd11441e10a drm/i915: Enable Display WA 0528 3276d4f570d8 drm/i915: Add skl_check_nv12_surface for NV12
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for Enable NV12 support (rev2)
In reply to Vidya Srinivas== Series Details ==
== Series Details ==
Series: Enable NV12 support (rev2)
URL : https://patchwork.freedesktop.org/series/41674/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4060 -> Patchwork_8717 =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8717 need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8717, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41674/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8717:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_gttfill@basic:
fi-pnv-d510: SKIP -> PASS== Known issues ==
Here are the changes found in Patchwork_8717 that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@gvt_basic@invalid-placeholder-test:
fi-glk-1: NOTRUN -> INCOMPLETE (fdo#103359, k.org#198133)
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-ivb-3520m: PASS -> DMESG-WARN (fdo#106084)
==== Possible fixes ====
igt@kms_pipe_crc_basic@read-crc-pipe-b:
fi-glk-j4005: DMESG-WARN (fdo#106097) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b:
fi-snb-2520m: INCOMPLETE (fdo#103713) -> PASS
fi-bxt-dsi: INCOMPLETE (fdo#103927) -> PASS
igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
fi-ivb-3520m: DMESG-WARN (fdo#106084) -> PASS +1 fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#106084 https://bugs.freedesktop.org/show_bug.cgi?id=106084
fdo#106097 https://bugs.freedesktop.org/show_bug.cgi?id=106097
k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133
== Participating hosts (34 -> 33) ==
Additional (1): fi-glk-1
Missing (2): fi-ilk-m540 fi-skl-6700hq
== Build changes ==
* Linux: CI_DRM_4060 -> Patchwork_8717
CI_DRM_4060: 17148956c3830de3194c17693be76f85f05f692f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8717: 3276d4f570d86e2ac858d4b6b8469a4b875729b1 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit
== Linux commits ==
3276d4f570d8 drm/i915: Add skl_check_nv12_surface for NV12 7cd11441e10a drm/i915: Enable Display WA 0528a8ee79b84f5d drm/i915: Add NV12 support to intel_framebuffer_init c5d7ac7c4cc8 drm/i915: Add NV12 as supported format for sprite plane 75716cad6db9 drm/i915: Add NV12 as supported format for primary plane e7aa87c8fdf6 drm/i915: Enable display workaround 827 for all planes, v2.
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8717/issues.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for Enable NV12 support (rev2)
In reply to Vidya Srinivas== Series Details ==
== Series Details ==
Series: Enable NV12 support (rev2)
URL : https://patchwork.freedesktop.org/series/41674/
State : success
== Summary ==
= CI Bug Log - changes from CI_DRM_4060_full -> Patchwork_8717_full =
== Summary - WARNING ==
Minor unknown changes coming with Patchwork_8717_full need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_8717_full, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://patchwork.freedesktop.org/api/1.0/series/41674/revisions/2/mbox/
== Possible new issues ==
Here are the unknown changes that may have been introduced in Patchwork_8717_full:
=== IGT changes ===
==== Warnings ====
igt@gem_exec_schedule@deep-bsd1:
shard-kbl: SKIP -> PASS +1
igt@gem_mocs_settings@mocs-rc6-ctx-dirty-render:
shard-kbl: PASS -> SKIP +2== Known issues ==
Here are the changes found in Patchwork_8717_full that come from known issues:
=== IGT changes ===
==== Issues hit ====
igt@kms_sysfs_edid_timing:
shard-apl: PASS -> WARN (fdo#100047)
==== Possible fixes ====
igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
shard-hsw: FAIL (fdo#104873) -> PASS fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#104873 https://bugs.freedesktop.org/show_bug.cgi?id=104873
== Participating hosts (6 -> 4) ==
Missing (2): shard-glk shard-glkb
== Build changes ==
* Linux: CI_DRM_4060 -> Patchwork_8717
CI_DRM_4060: 17148956c3830de3194c17693be76f85f05f692f @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_4441: 83ba5b7d3bde48b383df41792fc9c955a5a23bdb @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_8717: 3276d4f570d86e2ac858d4b6b8469a4b875729b1 @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4441: e60d247eb359f044caf0c09904da14e39d7adca1 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_8717/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx