drm: More plane clipping polish
Subsystems (19)
cover drm: More plane clipping polish
From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]>
This series first unifies all users of drm_atomic_helper_check_plane_state() to populate the clip rectangle with drm_mode_get_hv_timing(), and once everything is unified the clip rectangle handling is sucked into drm_atomic_helper_check_plane_state() away from driver code.
Entire series available here:git://github.com/vsyrjala/linux.git atomic_plane_helper_clip
Ville Syrjälä (15):
drm/i915: Reject odd pipe source width with double wide/dual link drm/i915: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane
clip rectangle
drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/meson: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane
clip rectangle
drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip
rectangle
drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle
drm: Don't pass clip to drm_atomic_helper_check_plane_state()
drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- drivers/gpu/drm/arm/malidp_planes.c | 5 +---- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- drivers/gpu/drm/meson/meson_plane.c | 6 +----- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- drivers/gpu/drm/tegra/dc.c | 8 +------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 21 files changed, 35 insertions(+), 117 deletions(-)
Signature · 1 line
2.13.6
PATCH 1/15 drm/i915: Reject odd pipe source width with double wide/dual link
From: Ville Syrjälä <[email protected]>
In order to guarantee that pipe_src_w/h matches the user mode h/vdisplay we must not adjust pipe_src_w to accommodate double wide/dual link. Instead just reject the mode outright.
This will allows us to rely on crtc_state->mode for plane clipping.
--- drivers/gpu/drm/i915/intel_display.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_display.c +12 -3
@@ -6332,9 +6332,18 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* - LVDS dual channel mode * - Double wide pipe */ -if ((intel_crtc_has_type (pipe_config,INTEL_OUTPUT_LVDS ) && -intel_is_dual_link_lvds (dev)) || pipe_config->double_wide) - pipe_config->pipe_src_w &= ~1 ; +if (pipe_config->pipe_src_w &1 ) { +if (pipe_config->double_wide) { +DRM_DEBUG_KMS ("Odd pipe source width not supported with double wide pipe\n" ); +return -EINVAL ; + } + +if (intel_crtc_has_type (pipe_config,INTEL_OUTPUT_LVDS ) && +intel_is_dual_link_lvds (dev)) { +DRM_DEBUG_KMS ("Odd pipe source width not supported with dual link LVDS\n" ); +return -EINVAL ; + } + }/* Cantiga+ cannot handle modes with a hsync front porch of 0. * WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw.
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [Intel-gfx] [PATCH 01/15] drm/i915: Reject odd pipe source width with double wide/dual link
Quoted 10 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
In order to guarantee that pipe_src_w/h matches the user mode h/vdisplay we must not adjust
pipe_src_wto accommodate double wide/dual link. Instead just reject the mode outright.This will allows us to rely on
crtc_state->modefor plane clipping.Cc Laurent Pinchart <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Might be real good if we have some igt that injects all these kinds of funny modes, just to check for bugs and stuff (i.e. not encoding any expectations that any of them work). Or maybe we need a smart fuzzer for the atomic ioctl for that.
Musings aside, on patches 1&2:
Quoted 37 lines
--- drivers/gpu/drm/i915/intel_display.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-)drivers/gpu/drm/i915/intel_display.c +12
-3@@ -6332,9 +6332,18 @@ static int intel_crtc_compute_config(struct intel_crtc *crtc,* - LVDS dual channel mode * - Double wide pipe */ -if ((intel_crtc_has_type (pipe_config,INTEL_OUTPUT_LVDS ) && -intel_is_dual_link_lvds (dev)) || pipe_config->double_wide) - pipe_config->pipe_src_w &= ~1 ; +if (pipe_config->pipe_src_w &1 ) { +if (pipe_config->double_wide) { +DRM_DEBUG_KMS ("Odd pipe source width not supported with double wide pipe\n" ); +return -EINVAL ; + } + +if (intel_crtc_has_type (pipe_config,INTEL_OUTPUT_LVDS ) && +intel_is_dual_link_lvds (dev)) { +DRM_DEBUG_KMS ("Odd pipe source width not supported with dual link LVDS\n" ); +return -EINVAL ; + } + }/* Cantiga+ cannot handle modes with a hsync front porch of 0. * WaPruneModeWithIncorrectHsyncOffset:ctg,elk,ilk,snb,ivb,vlv,hsw. Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 2/15 drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. No functional changes since pipe_src_w/h are already filled via drm_mode_get_hv_timing().
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 14 ++++++++++++-- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- 4 files changed, 18 insertions(+), 13 deletions(-)
drivers/gpu/drm/i915/intel_atomic_plane.c +0 -8
@@ -129,14 +129,6 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_if (!intel_state->base.crtc && !old_plane_state->base.crtc)return 0 ; -/* Clip all planes to CRTC size, or 0x0 if CRTC is disabled */ - intel_state->clip.x1 =0 ; - intel_state->clip.y1 =0 ; - intel_state->clip.x2 = - crtc_state->base.enable ? crtc_state->pipe_src_w :0 ; - intel_state->clip.y2 = - crtc_state->base.enable ? crtc_state->pipe_src_h :0 ; -if (state->fb &&drm_rotation_90_or_270 (state->rotation)) {struct drm_format_name_buf format_name;
drivers/gpu/drm/i915/intel_display.c +12 -2
@@ -9267,13 +9267,18 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb; +struct drm_rect clip = {};int src_x, src_y;u32 offset;int ret; +if (crtc_state->base.enable) +drm_mode_get_hv_timing (&crtc_state->base.mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (&plane_state->base, &crtc_state->base, - &plane_state->clip, + &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
@@ -12832,6 +12837,7 @@ intel_check_primary_plane(struct intel_plane *plane,int min_scale =DRM_PLANE_HELPER_NO_SCALING ;int max_scale =DRM_PLANE_HELPER_NO_SCALING ;bool can_position = false; +struct drm_rect clip = {};int ret;if (INTEL_GEN (dev_priv) >=9 ) {
@@ -12843,9 +12849,13 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } +if (crtc_state->base.enable) +drm_mode_get_hv_timing (&crtc_state->base.mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (&state->base, &crtc_state->base, - &state->clip, + &clip, min_scale, max_scale, can_position, true);if (ret)
drivers/gpu/drm/i915/intel_drv.h +0 -1
@@ -403,7 +403,6 @@ struct intel_atomic_state {struct intel_plane_state {struct drm_plane_state base; -struct drm_rect clip;struct i915_vma *vma;struct {
drivers/gpu/drm/i915/intel_sprite.c +6 -2
@@ -864,7 +864,7 @@ intel_check_sprite_plane(struct intel_plane *plane,uint32_t src_x, src_y, src_w, src_h;struct drm_rect *src = &state->base.src;struct drm_rect *dst = &state->base.dst; -const struct drm_rect *clip = &state->clip; +struct drm_rect clip = {};int hscale, vscale;int max_scale, min_scale;bool can_scale;
@@ -922,7 +922,11 @@ intel_check_sprite_plane(struct intel_plane *plane, vscale =drm_rect_calc_vscale_relaxed (src, dst, min_scale, max_scale);BUG_ON (vscale <0 ); - state->base.visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); +if (crtc_state->base.enable) +drm_mode_get_hv_timing (&crtc_state->base.mode, + &clip.x2, &clip.y2); + + state->base.visible =drm_rect_clip_scaled (src, dst, &clip, hscale, vscale); crtc_x = dst->x1; crtc_y = dst->y1;
Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 3/15 drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +3 -2
@@ -249,8 +249,9 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 03/15] drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.Note that this replaces
crtc_state->adjusted_modeusage withcrtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Quoted 8 lines
Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().Cc Laurent Pinchart <[email protected]>Cc Liviu Dudau <[email protected]>Cc Brian Starkey <[email protected]>Cc Mali DP Maintainers <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Please let me know if you need me to pull this patch into the HDLCD tree.
Best regards,
Liviu
Quoted 27 lines
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +3
-2@@ -249,8 +249,9 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develPATCH 4/15 drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/arm/malidp_planes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/arm/malidp_planes.c +4 -2
@@ -148,8 +148,10 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,if (!crtc_state)return -EINVAL ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip,0 ,INT_MAX , true, true);if (ret)
Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 04/15] drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.Note that this replaces
crtc_state->adjusted_modeusage withcrtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Quoted 8 lines
Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().Cc Laurent Pinchart <[email protected]>Cc Liviu Dudau <[email protected]>Cc Brian Starkey <[email protected]>Cc Mali DP Maintainers <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Please let me know if you need me to pull this patch into the mali-dp tree.
Best regards,
Liviu
Quoted 24 lines
--- drivers/gpu/drm/arm/malidp_planes.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/gpu/drm/arm/malidp_planes.c +4
-2@@ -148,8 +148,10 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,if (!crtc_state)return -EINVAL ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip,0 ,INT_MAX , true, true);if (ret)Signature · 1 line
2.13.6
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxPATCH 5/15 drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/drm_simple_kms_helper.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_simple_kms_helper.c +3 -2
@@ -100,8 +100,9 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */ - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(plane_state, crtc_state, &clip,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 6/15 drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/imx/ipuv3-plane.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/imx/ipuv3-plane.c +5 -5
@@ -322,7 +322,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *old_fb = old_state->fb;unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba;bool can_position = (plane->type ==DRM_PLANE_TYPE_OVERLAY ); -struct drm_rect clip; +struct drm_rect clip = {};int hsub, vsub;int ret;
@@ -338,10 +338,10 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 06/15] drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 8 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.Note that this replaces
crtc_state->adjusted_modeusage withcrtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
I am not aware of any adjustments that change hdisplay/vdisplay anyway,
regards
Philipp
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 7/15 drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/mediatek/mtk_drm_plane.c +3 -2
@@ -108,8 +108,9 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/15] drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 7 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.No functional changes as the code already uses
crtc_state->modeto populate the clip, which is also whatdrm_mode_get_hv_timing()uses.
I don't understand this explanation, drm_mode_get_hv_timing uses whichever mode is passed to it?
Quoted 2 lines
Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().
I can see that there are no functional changes though,
regards
Philipp
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 07/15] drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 11 lines · Philipp Zabel
Quoted 7 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.No functional changes as the code already uses
crtc_state->modeto populate the clip, which is also whatdrm_mode_get_hv_timing()uses.I don't understand this explanation,
drm_mode_get_hv_timinguses whichever mode is passed to it?
Hmm. I worded that badly it seems. The point is that we pass the user mode everywhere else where we want to know the dimensions of the crtc coordinate space.
Quoted 10 lines
Quoted 3 lines
Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().I can see that there are no functional changes though,
Acked-by Philipp Zabel <[email protected]>regards
Philipp
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 8/15 drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/meson/meson_plane.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/meson/meson_plane.c +3 -2
@@ -58,8 +58,9 @@ static int meson_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 9/15 drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +10 -10
@@ -286,7 +286,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,uint32_t max_width, max_height;bool out_of_bounds = false;uint32_t caps =0 ; -struct drm_rect clip; +struct drm_rect clip = {};int min_scale, max_scale;int ret;
@@ -320,13 +320,13 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,return -ERANGE ; } - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, min_scale, max_scale, true, true);
@@ -471,7 +471,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, {struct mdp5_plane_state *mdp5_state =to_mdp5_plane_state (state);struct drm_crtc_state *crtc_state; -struct drm_rect clip; +struct drm_rect clip = {};int min_scale, max_scale;int ret;
@@ -499,13 +499,13 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, plane->state->fb != state->fb)return -EINVAL ; - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, min_scale, max_scale, true, true);
Signature · 1 line
2.13.6
Re: [PATCH 09/15] drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.Note that this replaces
crtc_state->adjusted_modeusage withcrtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().
For this and the msm change in patch # 15/15:
Thanks,
Archit
Quoted 70 lines
Cc Laurent Pinchart <[email protected]>Cc Rob Clark <[email protected]>Cc Archit Taneja <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +10
-10@@ -286,7 +286,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,uint32_t max_width, max_height;bool out_of_bounds = false;uint32_t caps =0 ; -struct drm_rect clip; +struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -320,13 +320,13 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,return -ERANGE ; } - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, min_scale, max_scale, true, true);@@ -471,7 +471,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, {struct mdp5_plane_state *mdp5_state =to_mdp5_plane_state (state);struct drm_crtc_state *crtc_state; -struct drm_rect clip; +struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -499,13 +499,13 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, plane->state->fb != state->fb)return -EINVAL ; - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, min_scale, max_scale, true, true);
Signature · 6 lines
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
A message that is not in the archive (sent off-list or not yet received): 20171123190502.28449-1-ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]
PATCH 10/15 drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane clip rectangle
From: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/nouveau/nv50_display.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-)
drivers/gpu/drm/nouveau/nv50_display.c +12 -8
@@ -228,8 +228,6 @@ struct nv50_wndw_atom {struct drm_plane_state state;u8 interval; -struct drm_rect clip; -struct {u32 handle;u16 offset:12 ;
@@ -840,10 +838,6 @@ nv50_wndw_atomic_check_acquire(struct nv50_wndw *wndw,int ret;NV_ATOMIC (drm,"%s acquire\n" , wndw->plane.name); - asyw->clip.x1 =0 ; - asyw->clip.y1 =0 ; - asyw->clip.x2 = asyh->state.mode.hdisplay; - asyw->clip.y2 = asyh->state.mode.vdisplay; asyw->image.w = fb->base.width; asyw->image.h = fb->base.height;
@@ -1141,10 +1135,15 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { + struct drm_rect clip = {};int ret; +if (asyh->state.enable) +drm_mode_get_hv_timing (&asyh->state.mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &asyw->clip, + &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
@@ -1428,13 +1427,18 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) {const struct drm_framebuffer *fb = asyw->state.fb; +struct drm_rect clip = {};int ret;if (!fb->format->depth)return -EINVAL ; +if (asyh->state.enable) +drm_mode_get_hv_timing (&asyh->state.mode, + &clip.x2, &clip.y2); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &asyw->clip, + &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
Signature · 6 lines
2.13.6 _______________________________________________ Nouveau mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/nouveau
PATCH 12/15 drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to a message not in the archiveFrom: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
No functional changes as the code already uses crtc_state->mode to populate the clip, which is also what drm_mode_get_hv_timing() uses.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/tegra/dc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/tegra/dc.c +4 -5
@@ -477,7 +477,7 @@ static int tegra_plane_state_add(struct tegra_plane *plane, {struct drm_crtc_state *crtc_state;struct tegra_dc_state *tegra; -struct drm_rect clip; +struct drm_rect clip = {};int err;/* Propagate errors from allocation or locking failures. */
@@ -485,10 +485,9 @@ static int tegra_plane_state_add(struct tegra_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->mode.hdisplay; - clip.y2 = crtc_state->mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2);/* Check plane state for visibility and calculate clipping bounds */ err = drm_atomic_helper_check_plane_state(state, crtc_state, &clip,
Signature · 1 line
2.13.6
A message that is not in the archive (sent off-list or not yet received): 20171123190502.28449-13-ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]
Thierry Reding
Acked-byRe: [PATCH 12/15] drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.No functional changes as the code already uses
crtc_state->modeto populate the clip, which is also whatdrm_mode_get_hv_timing()uses.Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().
Quoted 7 lines
Cc Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/[email protected]>Cc Thierry Reding <[email protected]>--- drivers/gpu/drm/tegra/dc.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
I assume you want to take this through drm-misc, so:
Thierry Reding
Reviewed-byQuoted 76 lines · Ville Syrjala
From: Ville Syrjälä <ville.syrjala-VuQAYsv1563Yd54FQh9/[email protected]>
This series first unifies all users of
drm_atomic_helper_check_plane_state()to populate the clip rectangle withdrm_mode_get_hv_timing(), and once everything is unified the clip rectangle handling is sucked intodrm_atomic_helper_check_plane_state()away from driver code.Entire series available here:
git://github.com/vsyrjala/linux.gitatomic_plane_helper_clipCc Archit Taneja <[email protected]>Cc Ben Skeggs <[email protected]>Cc Brian Starkey <[email protected]>Cc CK Hu <ck.hu-NuS5LvNUpcJWk0Htik3J/[email protected]>Cc Daniel Vetter <daniel-/[email protected]>Cc Laurent Pinchart <laurent.pinchart-ryLnwIuWjnjg/[email protected]>Cc Liviu Dudau <[email protected]>Cc Mali DP Maintainers <malidp-VeJGdqYn5oNWk0Htik3J/[email protected]>Cc Mark Yao <[email protected]>Cc Neil Armstrong <narmstrong-rdvid1DuHRBWk0Htik3J/[email protected]>Cc Noralf Trønnes <[email protected]>Cc Philipp Zabel <[email protected]>Cc Rob Clark <[email protected]>Cc Shawn Guo <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thierry Reding <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc VMware Graphics <linux-graphics-maintainer-pghWNbHTmq7QT0dZR+AlfA@public.gmane.org>Ville Syrjälä (15):
drm/i915: Reject odd pipe source width with double wide/dual link drm/i915: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/arm/hdlcd: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/arm/mali-dp: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/simple_kms_helper: Usedrm_mode_get_hv_timing()to populate plane
clip rectangle
drm/imx: Usedrm_mode_get_hv_timing()to populate plane clip rectangle drm/mediatek: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/meson: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/msm/mdp5: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/nouveau/kms/nv50: Usedrm_mode_get_hv_timing()to populate plane
clip rectangle
drm/rockchip: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/tegra/dc: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/vmwgfx: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/zte: Usedrm_mode_get_hv_timing()to populate plane clip rectangle
drm: Don't pass clip todrm_atomic_helper_check_plane_state()drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- drivers/gpu/drm/arm/malidp_planes.c | 5 +---- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- drivers/gpu/drm/meson/meson_plane.c | 6 +----- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------
Quoted 8 lines
drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- drivers/gpu/drm/tegra/dc.c | 8 +------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 21 files changed, 35 insertions(+), 117 deletions(-)
The series:
PATCH 11/15 drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +4 -5
@@ -641,7 +641,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data;int ret; -struct drm_rect clip; +struct drm_rect clip = {};int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) :DRM_PLANE_HELPER_NO_SCALING ; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :
@@ -654,10 +654,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, min_scale, max_scale,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 13/15 drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3 -4
@@ -449,10 +449,9 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,if (state->crtc) crtc_state =drm_atomic_get_new_crtc_state (state->state, state->crtc); -if (crtc_state && crtc_state->enable) { - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; - } +if (crtc_state && crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 13/15] drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle
This looks okay to me.
Quoted 42 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.Note that this replaces
crtc_state->adjusted_modeusage withcrtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().Cc Laurent Pinchart <[email protected]>Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3
-4@@ -449,10 +449,9 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane,if (state->crtc) crtc_state =drm_atomic_get_new_crtc_state (state->state, state->crtc); -if (crtc_state && crtc_state->enable) { - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; - } +if (crtc_state && crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); ret = drm_atomic_helper_check_plane_state(state, crtc_state, &clip, DRM_PLANE_HELPER_NO_SCALING,Signature · 1 line
2.13.6
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 14/15 drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle.
Note that this replaces crtc_state->adjusted_mode usage with crtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Once everyone agrees on this we can move the clip handling into drm_atomic_helper_check_plane_state().
--- drivers/gpu/drm/zte/zx_plane.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-)
drivers/gpu/drm/zte/zx_plane.c +8 -10
@@ -55,7 +55,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip; +struct drm_rect clip = {};int min_scale =FRAC_16_16 (1 ,8 );int max_scale =FRAC_16_16 (8 ,1 );
@@ -75,10 +75,9 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(plane_state, crtc_state, &clip, min_scale, max_scale,
@@ -292,7 +291,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip; +struct drm_rect clip = {};if (!crtc || !fb)return 0 ;
@@ -310,10 +309,9 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; - clip.x1 =0 ; - clip.y1 =0 ; - clip.x2 = crtc_state->adjusted_mode.hdisplay; - clip.y2 = crtc_state->adjusted_mode.vdisplay; +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, + &clip.x2, &clip.y2); return drm_atomic_helper_check_plane_state(plane_state, crtc_state, &clip,
Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 14/15] drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Use
drm_mode_get_hv_timing()to fill out the plane clip rectangle.Note that this replaces
crtc_state->adjusted_modeusage withcrtc_state->mode. The latter is the correct choice since that's the mode the user provided and it matches the plane crtc coordinates the user also provided.
Quoted 5 lines
Once everyone agrees on this we can move the clip handling into
drm_atomic_helper_check_plane_state().Cc Laurent Pinchart <[email protected]>Cc Shawn Guo <[email protected]>
Quoted 1 line
Signed-off-by Ville Syrjälä <[email protected]>
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 15/15 drm: Don't pass clip to drm_atomic_helper_check_plane_state()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Move the plane clip rectangle handling into drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details.
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ drivers/gpu/drm/arm/malidp_planes.c | 7 +------ drivers/gpu/drm/armada/armada_overlay.c | 6 +----- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ drivers/gpu/drm/i915/intel_display.c | 12 ------------ drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ drivers/gpu/drm/meson/meson_plane.c | 7 +------ drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ drivers/gpu/drm/tegra/dc.c | 7 +------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ drivers/gpu/drm/zte/zx_plane.c | 13 +------------ include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 18 files changed, 22 insertions(+), 122 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +1 -6
@@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {static int hdlcd_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { -struct drm_rect clip = {0 };struct drm_crtc_state *crtc_state;u32 src_h = state->src_h >>16 ;
@@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/arm/malidp_planes.c +1 -6
@@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,struct drm_crtc_state *crtc_state =drm_atomic_get_existing_crtc_state (state->state, state->crtc);struct malidp_crtc_state *mc; -struct drm_rect clip = {0 };u32 src_w, src_h;int ret;if (!crtc_state)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (ret)return ret;
drivers/gpu/drm/armada/armada_overlay.c +1 -5
@@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };uint32_t val, ctrl0;unsigned idx =0 ;bool visible;
@@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); - ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, + ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest,DRM_MODE_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)
drivers/gpu/drm/drm_atomic_helper.c +7 -5
@@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);* drm_atomic_helper_check_plane_state() - Check plane state for validity * @plane_state: plane state to check * @crtc_state: crtc state to check -* @clip: integer clipping coordinates * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point * @can_position: is it legal to position the plane such that it
@@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);*/ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,
@@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,struct drm_rect *src = &plane_state->src;struct drm_rect *dst = &plane_state->dst;unsigned int rotation = plane_state->rotation; +struct drm_rect clip = {};int hscale, vscale;WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc);
@@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,return -ERANGE ; } - plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, &clip.x2, &clip.y2); + + plane_state->visible =drm_rect_clip_scaled (src, dst, &clip, hscale, vscale);drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation);
@@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,*/ return 0 ; -if (!can_position && !drm_rect_equals (dst, clip)) { +if (!can_position && !drm_rect_equals (dst, &clip)) {DRM_DEBUG_KMS ("Plane must cover entire CRTC\n" );drm_rect_debug_print ("dst: " , dst, false); -drm_rect_debug_print ("clip: " , clip, false); +drm_rect_debug_print ("clip: " , &clip, false);return -EINVAL ; }
drivers/gpu/drm/drm_plane_helper.c +3 -8
@@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,* @fb: framebuffer to flip onto plane * @src: source coordinates in 16.16 fixed point * @dst: integer destination coordinates -* @clip: integer clipping coordinates * @rotation: plane rotation * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point
@@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dst, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,
@@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_crtc_state crtc_state = { .crtc = crtc, .enable = crtc->enabled, + .mode = crtc->mode, };int ret; ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, - clip, min_scale, max_scale, + min_scale, max_scale, can_position, can_update_disabled);if (ret)
@@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };struct drm_connector **connector_list;int num_connectors, ret;bool visible; ret = drm_plane_helper_check_update(plane, crtc, fb, - &src, &dest, &clip, + &src, &dest, DRM_MODE_ROTATE_0, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,
drivers/gpu/drm/drm_simple_kms_helper.c +0 -6
@@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = {static int drm_simple_kms_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *plane_state) { -struct drm_rect clip = {0 };struct drm_simple_display_pipe *pipe;struct drm_crtc_state *crtc_state;int ret;
@@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */ -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/i915/intel_display.c +0 -12
@@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb; -struct drm_rect clip = {};int src_x, src_y;u32 offset;int ret; -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&plane_state->base, &crtc_state->base, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
@@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane,int min_scale =DRM_PLANE_HELPER_NO_SCALING ;int max_scale =DRM_PLANE_HELPER_NO_SCALING ;bool can_position = false; -struct drm_rect clip = {};int ret;if (INTEL_GEN (dev_priv) >=9 ) {
@@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&state->base, &crtc_state->base, - &clip, min_scale, max_scale, can_position, true);if (ret)
drivers/gpu/drm/imx/ipuv3-plane.c +1 -6
@@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *old_fb = old_state->fb;unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba;bool can_position = (plane->type ==DRM_PLANE_TYPE_OVERLAY ); -struct drm_rect clip = {};int hsub, vsub;int ret;
@@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -6
@@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, {struct drm_framebuffer *fb = state->fb;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!fb)return 0 ;
@@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
drivers/gpu/drm/meson/meson_plane.c +1 -6
@@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!state->crtc)return 0 ;
@@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2 -12
@@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,uint32_t max_width, max_height;bool out_of_bounds = false;uint32_t caps =0 ; -struct drm_rect clip = {};int min_scale, max_scale;int ret;
@@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)
@@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, {struct mdp5_plane_state *mdp5_state =to_mdp5_plane_state (state);struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale, max_scale;int ret;
@@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)
drivers/gpu/drm/nouveau/nv50_display.c +0 -12
@@ -1135,15 +1135,9 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct drm_rect clip = {}; int ret; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
@@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) {const struct drm_framebuffer *fb = asyw->state.fb; -struct drm_rect clip = {};int ret;if (!fb->format->depth)return -EINVAL ; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1 -6
@@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data;int ret; -struct drm_rect clip = {};int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) :DRM_PLANE_HELPER_NO_SCALING ; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :
@@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)
drivers/gpu/drm/tegra/dc.c +1 -6
@@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, {struct drm_crtc_state *crtc_state;struct tegra_dc_state *tegra; -struct drm_rect clip = {};int err;/* Propagate errors from allocation or locking failures. */
@@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -/* Check plane state for visibility and calculate clipping bounds */ - err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + err =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (err <0 )return err;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -6
@@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, {struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = {};int ret;if (state->crtc) crtc_state =drm_atomic_get_new_crtc_state (state->state, state->crtc); -if (crtc_state && crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/zte/zx_plane.c +1 -12
@@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale =FRAC_16_16 (1 ,8 );int max_scale =FRAC_16_16 (8 ,1 );
@@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip, min_scale, max_scale, + min_scale, max_scale, true, true); }
@@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};if (!crtc || !fb)return 0 ;
@@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
include/drm/drm_atomic_helper.h +0 -1
@@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_atomic_state *state); int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,
include/drm/drm_plane_helper.h +0 -1
@@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dest, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Liviu Dudau
maintainerRe: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state()
Quoted 1 line · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Hi Ville,
Quoted 4 lines
Move the plane clip rectangle handling into
drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details.
This is quite an important patch and I dare say the essence of your series, right? Yet very few people got Cc-ed on it (1 AFAICT) and it touches quite a few drivers.
May I respectfully suggest that you review your patch sending process? You have Cc-ed me only on patches 3 and 4 and I could easy asssume that those were all the changes you have made to the driver, which is obviously not the case here.
I tend to err on the side of verbosity and include everyone touched by a patch in a series into all the patches of that series. Is by no mean the best approach, but is one way I avoid situations like this.
Best regards,
Liviu
Quoted 586 lines
Cc Laurent Pinchart <[email protected]>Cc Daniel Vetter <[email protected]>Suggested-by Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ drivers/gpu/drm/arm/malidp_planes.c | 7 +------ drivers/gpu/drm/armada/armada_overlay.c | 6 +----- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ drivers/gpu/drm/i915/intel_display.c | 12 ------------ drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ drivers/gpu/drm/meson/meson_plane.c | 7 +------ drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ drivers/gpu/drm/tegra/dc.c | 7 +------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ drivers/gpu/drm/zte/zx_plane.c | 13 +------------ include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 18 files changed, 22 insertions(+), 122 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +1
-6@@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {static int hdlcd_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { -struct drm_rect clip = {0 };struct drm_crtc_state *crtc_state;u32 src_h = state->src_h >>16 ;@@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/arm/malidp_planes.c +1
-6@@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,struct drm_crtc_state *crtc_state =drm_atomic_get_existing_crtc_state (state->state, state->crtc);struct malidp_crtc_state *mc; -struct drm_rect clip = {0 };u32 src_w, src_h;int ret;if (!crtc_state)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (ret)return ret;drivers/gpu/drm/armada/armada_overlay.c +1
-5@@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };uint32_t val, ctrl0;unsigned idx =0 ;bool visible;@@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); - ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, + ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest,DRM_MODE_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)drivers/gpu/drm/drm_atomic_helper.c +7
-5@@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);* drm_atomic_helper_check_plane_state() - Check plane state for validity * @plane_state: plane state to check * @crtc_state: crtc state to check -* @clip: integer clipping coordinates * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point * @can_position: is it legal to position the plane such that it @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);*/ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,@@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,struct drm_rect *src = &plane_state->src;struct drm_rect *dst = &plane_state->dst;unsigned int rotation = plane_state->rotation; +struct drm_rect clip = {};int hscale, vscale;WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc);@@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,return -ERANGE ; } - plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, &clip.x2, &clip.y2); + + plane_state->visible =drm_rect_clip_scaled (src, dst, &clip, hscale, vscale);drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation);@@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,*/ return 0 ; -if (!can_position && !drm_rect_equals (dst, clip)) { +if (!can_position && !drm_rect_equals (dst, &clip)) {DRM_DEBUG_KMS ("Plane must cover entire CRTC\n" );drm_rect_debug_print ("dst: " , dst, false); -drm_rect_debug_print ("clip: " , clip, false); +drm_rect_debug_print ("clip: " , &clip, false);return -EINVAL ; }drivers/gpu/drm/drm_plane_helper.c +3
-8@@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,* @fb: framebuffer to flip onto plane * @src: source coordinates in 16.16 fixed point * @dst: integer destination coordinates -* @clip: integer clipping coordinates * @rotation: plane rotation * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dst, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,@@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_crtc_state crtc_state = { .crtc = crtc, .enable = crtc->enabled, + .mode = crtc->mode, };int ret; ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, - clip, min_scale, max_scale, + min_scale, max_scale, can_position, can_update_disabled);if (ret)@@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };struct drm_connector **connector_list;int num_connectors, ret;bool visible; ret = drm_plane_helper_check_update(plane, crtc, fb, - &src, &dest, &clip, + &src, &dest, DRM_MODE_ROTATE_0, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,drivers/gpu/drm/drm_simple_kms_helper.c +0
-6@@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = {static int drm_simple_kms_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *plane_state) { -struct drm_rect clip = {0 };struct drm_simple_display_pipe *pipe;struct drm_crtc_state *crtc_state;int ret;@@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */ -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/i915/intel_display.c +0
-12@@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb; -struct drm_rect clip = {};int src_x, src_y;u32 offset;int ret; -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&plane_state->base, &crtc_state->base, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane,int min_scale =DRM_PLANE_HELPER_NO_SCALING ;int max_scale =DRM_PLANE_HELPER_NO_SCALING ;bool can_position = false; -struct drm_rect clip = {};int ret;if (INTEL_GEN (dev_priv) >=9 ) {@@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&state->base, &crtc_state->base, - &clip, min_scale, max_scale, can_position, true);if (ret)drivers/gpu/drm/imx/ipuv3-plane.c +1
-6@@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *old_fb = old_state->fb;unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba;bool can_position = (plane->type ==DRM_PLANE_TYPE_OVERLAY ); -struct drm_rect clip = {};int hsub, vsub;int ret;@@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);drivers/gpu/drm/mediatek/mtk_drm_plane.c +1
-6@@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, {struct drm_framebuffer *fb = state->fb;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!fb)return 0 ;@@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/meson/meson_plane.c +1
-6@@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!state->crtc)return 0 ;@@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-12@@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,uint32_t max_width, max_height;bool out_of_bounds = false;uint32_t caps =0 ; -struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)@@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, {struct mdp5_plane_state *mdp5_state =to_mdp5_plane_state (state);struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/nouveau/nv50_display.c +0
-12@@ -1135,15 +1135,9 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct drm_rect clip = {}; int ret; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) {const struct drm_framebuffer *fb = asyw->state.fb; -struct drm_rect clip = {};int ret;if (!fb->format->depth)return -EINVAL ; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-6@@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data;int ret; -struct drm_rect clip = {};int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) :DRM_PLANE_HELPER_NO_SCALING ; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :@@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/tegra/dc.c +1
-6@@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, {struct drm_crtc_state *crtc_state;struct tegra_dc_state *tegra; -struct drm_rect clip = {};int err;/* Propagate errors from allocation or locking failures. */ @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -/* Check plane state for visibility and calculate clipping bounds */ - err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + err =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (err <0 )return err;drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-6@@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, {struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = {};int ret;if (state->crtc) crtc_state =drm_atomic_get_new_crtc_state (state->state, state->crtc); -if (crtc_state && crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/zte/zx_plane.c +1
-12@@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale =FRAC_16_16 (1 ,8 );int max_scale =FRAC_16_16 (8 ,1 );@@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip, min_scale, max_scale, + min_scale, max_scale, true, true); }@@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};if (!crtc || !fb)return 0 ;@@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);include/drm/drm_atomic_helper.h +0
-1@@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_atomic_state *state); int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,include/drm/drm_plane_helper.h +0
-1@@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dest, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develRe: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state()
Quoted 6 lines · Liviu Dudau
Quoted 1 line · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Hi Ville,
Quoted 1 line
Quoted 7 lines
Quoted 3 lines
Move the plane clip rectangle handling into
drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details.This is quite an important patch and I dare say the essence of your series, right? Yet very few people got Cc-ed on it (1 AFAICT) and it touches quite a few drivers.
It has no functional changes, so forgetting to plaster it with Ccs doesn't seem all that dangerous. All the (potentially) functional changes were in the prep patches which had Ccs, as did the cover letter. And maintainers should read the ml anyway ;)
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Liviu Dudau
maintainerRe: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state()
Quoted 11 lines · Ville Syrjälä
Quoted 10 lines · Liviu Dudau
Quoted 1 line · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Hi Ville,
Quoted 4 lines
Move the plane clip rectangle handling into
drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details.
Quoted 8 lines
Quoted 3 lines
This is quite an important patch and I dare say the essence of your series, right? Yet very few people got Cc-ed on it (1 AFAICT) and it touches quite a few drivers.
It has no functional changes, so forgetting to plaster it with Ccs doesn't seem all that dangerous. All the (potentially) functional changes were in the prep patches which had Ccs, as did the cover letter. And maintainers should read the ml anyway ;)
Maintainers don't maintain the functionality, they maintain the source code. They fix conflicts and order patches. On that line, not Cc-ing maintainers when you change the code of the drivers they maintain makes their lives all more ... "entertaining".
And I would argue that the patch does introduce functional changes, as it removes the clip rectangle from drm_atomic_helper_check_plane_state()'s list of parameters. It does change all the users of it, too, I agree, but not for people that have drivers not yet upstreamed (and they start to wonder how one driver compiles and other fails when they were supposed to have the same code inside :) )
Regards,
Liviu
Quoted 4 lines
Signature · 3 lines
-- Ville Syrjälä Intel OTC
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfxRe: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state()
In reply to Ville SyrjalaQuoted 70 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Move the plane clip rectangle handling into
drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details.Cc Laurent Pinchart <[email protected]>Cc Daniel Vetter <[email protected]>Suggested-by Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ drivers/gpu/drm/arm/malidp_planes.c | 7 +------ drivers/gpu/drm/armada/armada_overlay.c | 6 +----- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ drivers/gpu/drm/i915/intel_display.c | 12 ------------ drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ drivers/gpu/drm/meson/meson_plane.c | 7 +------ drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ drivers/gpu/drm/tegra/dc.c | 7 +------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ drivers/gpu/drm/zte/zx_plane.c | 13 +------------ include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 18 files changed, 22 insertions(+), 122 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +1
-6@@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {static int hdlcd_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { -struct drm_rect clip = {0 };struct drm_crtc_state *crtc_state;u32 src_h = state->src_h >>16 ;@@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/arm/malidp_planes.c +0
-1@@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,struct drm_crtc_state *crtc_state =drm_atomic_get_existing_crtc_state (state->state, state->crtc);struct malidp_crtc_state *mc; -struct drm_rect clip = {0 };u32 src_w, src_h;int ret;if (!crtc_state)return -EINVAL ;
drivers/gpu/drm/arm/malidp_planes.c static int malidp_se_check_scaling(struct malidp_plane *mp, · line 153
Quoted 10 lines
drivers/gpu/drm/arm/malidp_planes.c +1
-5-if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (ret)return ret;
For the hdlcd and malidp changes above:
Best regards,
Liviu
Quoted 511 lines
drivers/gpu/drm/armada/armada_overlay.c +1
-5@@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };uint32_t val, ctrl0;unsigned idx =0 ;bool visible;@@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); - ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, + ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest,DRM_MODE_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)drivers/gpu/drm/drm_atomic_helper.c +7
-5@@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);* drm_atomic_helper_check_plane_state() - Check plane state for validity * @plane_state: plane state to check * @crtc_state: crtc state to check -* @clip: integer clipping coordinates * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point * @can_position: is it legal to position the plane such that it @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);*/ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,@@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,struct drm_rect *src = &plane_state->src;struct drm_rect *dst = &plane_state->dst;unsigned int rotation = plane_state->rotation; +struct drm_rect clip = {};int hscale, vscale;WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc);@@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,return -ERANGE ; } - plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, &clip.x2, &clip.y2); + + plane_state->visible =drm_rect_clip_scaled (src, dst, &clip, hscale, vscale);drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation);@@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,*/ return 0 ; -if (!can_position && !drm_rect_equals (dst, clip)) { +if (!can_position && !drm_rect_equals (dst, &clip)) {DRM_DEBUG_KMS ("Plane must cover entire CRTC\n" );drm_rect_debug_print ("dst: " , dst, false); -drm_rect_debug_print ("clip: " , clip, false); +drm_rect_debug_print ("clip: " , &clip, false);return -EINVAL ; }drivers/gpu/drm/drm_plane_helper.c +3
-8@@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,* @fb: framebuffer to flip onto plane * @src: source coordinates in 16.16 fixed point * @dst: integer destination coordinates -* @clip: integer clipping coordinates * @rotation: plane rotation * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dst, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,@@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_crtc_state crtc_state = { .crtc = crtc, .enable = crtc->enabled, + .mode = crtc->mode, };int ret; ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, - clip, min_scale, max_scale, + min_scale, max_scale, can_position, can_update_disabled);if (ret)@@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };struct drm_connector **connector_list;int num_connectors, ret;bool visible; ret = drm_plane_helper_check_update(plane, crtc, fb, - &src, &dest, &clip, + &src, &dest, DRM_MODE_ROTATE_0, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,drivers/gpu/drm/drm_simple_kms_helper.c +0
-6@@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = {static int drm_simple_kms_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *plane_state) { -struct drm_rect clip = {0 };struct drm_simple_display_pipe *pipe;struct drm_crtc_state *crtc_state;int ret;@@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */ -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/i915/intel_display.c +0
-12@@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb; -struct drm_rect clip = {};int src_x, src_y;u32 offset;int ret; -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&plane_state->base, &crtc_state->base, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane,int min_scale =DRM_PLANE_HELPER_NO_SCALING ;int max_scale =DRM_PLANE_HELPER_NO_SCALING ;bool can_position = false; -struct drm_rect clip = {};int ret;if (INTEL_GEN (dev_priv) >=9 ) {@@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&state->base, &crtc_state->base, - &clip, min_scale, max_scale, can_position, true);if (ret)drivers/gpu/drm/imx/ipuv3-plane.c +1
-6@@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *old_fb = old_state->fb;unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba;bool can_position = (plane->type ==DRM_PLANE_TYPE_OVERLAY ); -struct drm_rect clip = {};int hsub, vsub;int ret;@@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);drivers/gpu/drm/mediatek/mtk_drm_plane.c +1
-6@@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, {struct drm_framebuffer *fb = state->fb;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!fb)return 0 ;@@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/meson/meson_plane.c +1
-6@@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!state->crtc)return 0 ;@@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-12@@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,uint32_t max_width, max_height;bool out_of_bounds = false;uint32_t caps =0 ; -struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)@@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, {struct mdp5_plane_state *mdp5_state =to_mdp5_plane_state (state);struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/nouveau/nv50_display.c +0
-12@@ -1135,15 +1135,9 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct drm_rect clip = {}; int ret; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) {const struct drm_framebuffer *fb = asyw->state.fb; -struct drm_rect clip = {};int ret;if (!fb->format->depth)return -EINVAL ; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-6@@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data;int ret; -struct drm_rect clip = {};int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) :DRM_PLANE_HELPER_NO_SCALING ; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :@@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/tegra/dc.c +1
-6@@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, {struct drm_crtc_state *crtc_state;struct tegra_dc_state *tegra; -struct drm_rect clip = {};int err;/* Propagate errors from allocation or locking failures. */ @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -/* Check plane state for visibility and calculate clipping bounds */ - err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + err =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (err <0 )return err;drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-6@@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, {struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = {};int ret;if (state->crtc) crtc_state =drm_atomic_get_new_crtc_state (state->state, state->crtc); -if (crtc_state && crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/zte/zx_plane.c +1
-12@@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale =FRAC_16_16 (1 ,8 );int max_scale =FRAC_16_16 (8 ,1 );@@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip, min_scale, max_scale, + min_scale, max_scale, true, true); }@@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};if (!crtc || !fb)return 0 ;@@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);include/drm/drm_atomic_helper.h +0
-1@@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_atomic_state *state); int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,include/drm/drm_plane_helper.h +0
-1@@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dest, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 12 lines
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-develRe: [PATCH 15/15] drm: Don't pass clip to drm_atomic_helper_check_plane_state()
In reply to Ville SyrjalaQuoted 10 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Move the plane clip rectangle handling into
drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details.Cc Laurent Pinchart <[email protected]>Cc Daniel Vetter <[email protected]>Suggested-by Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
I guess the longer-term next step would be that we expose can_scale and can_position (and maybe the scaling limits?) as read-only properties, as hints to the compositor. And then move all the calls into the overall helpers (i.e. drm_atomic_helper_check_planes).
But this here is real sweet already I think.
Quoted 577 lines
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 7 +------ drivers/gpu/drm/arm/malidp_planes.c | 7 +------ drivers/gpu/drm/armada/armada_overlay.c | 6 +----- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 6 ------ drivers/gpu/drm/i915/intel_display.c | 12 ------------ drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 7 +------ drivers/gpu/drm/meson/meson_plane.c | 7 +------ drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 12 ------------ drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 7 +------ drivers/gpu/drm/tegra/dc.c | 7 +------ drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 7 +------ drivers/gpu/drm/zte/zx_plane.c | 13 +------------ include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 18 files changed, 22 insertions(+), 122 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +1
-6@@ -229,7 +229,6 @@ static const struct drm_crtc_helper_funcs hdlcd_crtc_helper_funcs = {static int hdlcd_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { -struct drm_rect clip = {0 };struct drm_crtc_state *crtc_state;u32 src_h = state->src_h >>16 ;@@ -249,11 +248,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane,return -EINVAL ; } -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/arm/malidp_planes.c +1
-6@@ -141,18 +141,13 @@ static int malidp_se_check_scaling(struct malidp_plane *mp,struct drm_crtc_state *crtc_state =drm_atomic_get_existing_crtc_state (state->state, state->crtc);struct malidp_crtc_state *mc; -struct drm_rect clip = {0 };u32 src_w, src_h;int ret;if (!crtc_state)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (ret)return ret;drivers/gpu/drm/armada/armada_overlay.c +1
-5@@ -111,10 +111,6 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };uint32_t val, ctrl0;unsigned idx =0 ;bool visible;@@ -124,7 +120,7 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); - ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest, &clip, + ret =drm_plane_helper_check_update (plane, crtc, fb, &src, &dest,DRM_MODE_ROTATE_0 ,0 ,INT_MAX , true, false, &visible);if (ret)drivers/gpu/drm/drm_atomic_helper.c +7
-5@@ -699,7 +699,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);* drm_atomic_helper_check_plane_state() - Check plane state for validity * @plane_state: plane state to check * @crtc_state: crtc state to check -* @clip: integer clipping coordinates * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point * @can_position: is it legal to position the plane such that it @@ -719,7 +718,6 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);*/ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,@@ -729,6 +727,7 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,struct drm_rect *src = &plane_state->src;struct drm_rect *dst = &plane_state->dst;unsigned int rotation = plane_state->rotation; +struct drm_rect clip = {};int hscale, vscale;WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc);@@ -764,7 +763,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,return -ERANGE ; } - plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); +if (crtc_state->enable) +drm_mode_get_hv_timing (&crtc_state->mode, &clip.x2, &clip.y2); + + plane_state->visible =drm_rect_clip_scaled (src, dst, &clip, hscale, vscale);drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation);@@ -778,10 +780,10 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,*/ return 0 ; -if (!can_position && !drm_rect_equals (dst, clip)) { +if (!can_position && !drm_rect_equals (dst, &clip)) {DRM_DEBUG_KMS ("Plane must cover entire CRTC\n" );drm_rect_debug_print ("dst: " , dst, false); -drm_rect_debug_print ("clip: " , clip, false); +drm_rect_debug_print ("clip: " , &clip, false);return -EINVAL ; }drivers/gpu/drm/drm_plane_helper.c +3
-8@@ -106,7 +106,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,* @fb: framebuffer to flip onto plane * @src: source coordinates in 16.16 fixed point * @dst: integer destination coordinates -* @clip: integer clipping coordinates * @rotation: plane rotation * @min_scale: minimum @src:@dest scaling factor in 16.16 fixed point * @max_scale: maximum @src:@dest scaling factor in 16.16 fixed point @@ -131,7 +130,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dst, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,@@ -157,11 +155,12 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_crtc_state crtc_state = { .crtc = crtc, .enable = crtc->enabled, + .mode = crtc->mode, };int ret; ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, - clip, min_scale, max_scale, + min_scale, max_scale, can_position, can_update_disabled);if (ret)@@ -239,16 +238,12 @@ int drm_primary_helper_update(struct drm_plane *plane, struct drm_crtc *crtc, .x2 = crtc_x + crtc_w, .y2 = crtc_y + crtc_h, }; -const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - };struct drm_connector **connector_list;int num_connectors, ret;bool visible; ret = drm_plane_helper_check_update(plane, crtc, fb, - &src, &dest, &clip, + &src, &dest, DRM_MODE_ROTATE_0, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,drivers/gpu/drm/drm_simple_kms_helper.c +0
-6@@ -89,7 +89,6 @@ static const struct drm_crtc_funcs drm_simple_kms_crtc_funcs = {static int drm_simple_kms_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *plane_state) { -struct drm_rect clip = {0 };struct drm_simple_display_pipe *pipe;struct drm_crtc_state *crtc_state;int ret;@@ -100,12 +99,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane,if (!crtc_state->enable)return 0 ;/* nothing to check when disabling or disabled */ -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/i915/intel_display.c +0
-12@@ -9267,18 +9267,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, struct intel_plane_state *plane_state) {const struct drm_framebuffer *fb = plane_state->base.fb; -struct drm_rect clip = {};int src_x, src_y;u32 offset;int ret; -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&plane_state->base, &crtc_state->base, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -12837,7 +12831,6 @@ intel_check_primary_plane(struct intel_plane *plane,int min_scale =DRM_PLANE_HELPER_NO_SCALING ;int max_scale =DRM_PLANE_HELPER_NO_SCALING ;bool can_position = false; -struct drm_rect clip = {};int ret;if (INTEL_GEN (dev_priv) >=9 ) {@@ -12849,13 +12842,8 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } -if (crtc_state->base.enable) -drm_mode_get_hv_timing (&crtc_state->base.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&state->base, &crtc_state->base, - &clip, min_scale, max_scale, can_position, true);if (ret)drivers/gpu/drm/imx/ipuv3-plane.c +1
-6@@ -322,7 +322,6 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *old_fb = old_state->fb;unsigned long eba, ubo, vbo, old_ubo, old_vbo, alpha_eba;bool can_position = (plane->type ==DRM_PLANE_TYPE_OVERLAY ); -struct drm_rect clip = {};int hsub, vsub;int ret;@@ -338,11 +337,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);drivers/gpu/drm/mediatek/mtk_drm_plane.c +1
-6@@ -91,7 +91,6 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, {struct drm_framebuffer *fb = state->fb;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!fb)return 0 ;@@ -108,11 +107,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/meson/meson_plane.c +1
-6@@ -49,7 +49,6 @@ static int meson_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_crtc_state *crtc_state; -struct drm_rect clip = {0 , };if (!state->crtc)return 0 ;@@ -58,11 +57,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - -return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +return drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-12@@ -286,7 +286,6 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state,uint32_t max_width, max_height;bool out_of_bounds = false;uint32_t caps =0 ; -struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -323,11 +322,7 @@ static int mdp5_plane_atomic_check_with_state(struct drm_crtc_state *crtc_state, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)@@ -471,7 +466,6 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, {struct mdp5_plane_state *mdp5_state =to_mdp5_plane_state (state);struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale, max_scale;int ret;@@ -502,11 +496,7 @@ static int mdp5_plane_atomic_async_check(struct drm_plane *plane, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/nouveau/nv50_display.c +0
-12@@ -1135,15 +1135,9 @@ static int nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) { - struct drm_rect clip = {}; int ret; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -1427,18 +1421,12 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, struct nv50_head_atom *asyh) {const struct drm_framebuffer *fb = asyw->state.fb; -struct drm_rect clip = {};int ret;if (!fb->format->depth)return -EINVAL ; -if (asyh->state.enable) -drm_mode_get_hv_timing (&asyh->state.mode, - &clip.x2, &clip.y2); - ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-6@@ -641,7 +641,6 @@ static int vop_plane_atomic_check(struct drm_plane *plane,struct vop_win *vop_win =to_vop_win (plane);const struct vop_win_data *win = vop_win->data;int ret; -struct drm_rect clip = {};int min_scale = win->phy->scl ?FRAC_16_16 (1 ,8 ) :DRM_PLANE_HELPER_NO_SCALING ; int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :@@ -654,11 +653,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,if (WARN_ON (!crtc_state))return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/tegra/dc.c +1
-6@@ -477,7 +477,6 @@ static int tegra_plane_state_add(struct tegra_plane *plane, {struct drm_crtc_state *crtc_state;struct tegra_dc_state *tegra; -struct drm_rect clip = {};int err;/* Propagate errors from allocation or locking failures. */ @@ -485,12 +484,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane,if (IS_ERR (crtc_state))return PTR_ERR (crtc_state); -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -/* Check plane state for visibility and calculate clipping bounds */ - err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + err =drm_atomic_helper_check_plane_state (state, crtc_state,0 ,INT_MAX , true, true);if (err <0 )return err;drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-6@@ -443,17 +443,12 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, {struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = {};int ret;if (state->crtc) crtc_state =drm_atomic_get_new_crtc_state (state->state, state->crtc); -if (crtc_state && crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); - - ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + ret =drm_atomic_helper_check_plane_state (state, crtc_state,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/zte/zx_plane.c +1
-12@@ -55,7 +55,6 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};int min_scale =FRAC_16_16 (1 ,8 );int max_scale =FRAC_16_16 (8 ,1 );@@ -75,12 +74,8 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip, min_scale, max_scale, + min_scale, max_scale, true, true); }@@ -291,7 +286,6 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,struct drm_framebuffer *fb = plane_state->fb;struct drm_crtc *crtc = plane_state->crtc;struct drm_crtc_state *crtc_state; -struct drm_rect clip = {};if (!crtc || !fb)return 0 ;@@ -309,12 +303,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,if (!plane_state->crtc)return -EINVAL ; -if (crtc_state->enable) -drm_mode_get_hv_timing (&crtc_state->mode, - &clip.x2, &clip.y2); -return drm_atomic_helper_check_plane_state (plane_state, crtc_state, - &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);include/drm/drm_atomic_helper.h +0
-1@@ -40,7 +40,6 @@ int drm_atomic_helper_check_modeset(struct drm_device *dev, struct drm_atomic_state *state); int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, const struct drm_crtc_state *crtc_state, - const struct drm_rect *clip, int min_scale, int max_scale, bool can_position,include/drm/drm_plane_helper.h +0
-1@@ -43,7 +43,6 @@ int drm_plane_helper_check_update(struct drm_plane *plane,struct drm_framebuffer *fb, struct drm_rect *src, struct drm_rect *dest, - const struct drm_rect *clip, unsigned int rotation, int min_scale, int max_scale,Signature · 1 line
2.13.6
Signature · 7 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm: More plane clipping polish
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: More plane clipping polish
URL : https://patchwork.freedesktop.org/series/34323/
State : success
== Summary ==
Series 34323v1 drm: More plane clipping polish
https://patchwork.freedesktop.org/api/1.0/series/34323/revisions/1/mbox/
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
incomplete -> PASS (fi-cfl-s2)fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:452s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:465s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:382s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:550s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:280s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:506s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:512s fi-byt-j1900 total:289 pass:254 dwarn:0 dfail:0 fail:0 skip:35 time:504s fi-byt-n2820 total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:503s fi-cfl-s2 total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:605s fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:431s fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:268s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:539s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:432s fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:440s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:431s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:482s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:469s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:580s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:458s fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:547s fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:570s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:521s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:505s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:462s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:560s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:424s Blacklisted hosts: fi-cnl-y total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:542s fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:497s fi-kbl-7500u total:289 pass:264 dwarn:1 dfail:0 fail:0 skip:24 time:486s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:530s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:475s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:534s
b407e5f38397c0c22b5056a1664753287993b152 drm-tip: 2017y-11m-23d-16h-14m-59s UTC integration manifest 975cf9bae7a3 drm: Don't pass clip to drm_atomic_helper_check_plane_state() 51ebe51a3012 drm/zte: Use drm_mode_get_hv_timing() to populate plane clip rectangle c376ca060824 drm/vmwgfx: Use drm_mode_get_hv_timing() to populate plane clip rectangle ed50094cf87d drm/tegra/dc: Use drm_mode_get_hv_timing() to populate plane clip rectangle 2b017f50a0d2 drm/rockchip: Use drm_mode_get_hv_timing() to populate plane clip rectangle bf76698f2b25 drm/nouveau/kms/nv50: Use drm_mode_get_hv_timing() to populate plane clip rectangle da6a67b6450b drm/msm/mdp5: Use drm_mode_get_hv_timing() to populate plane clip rectangle 90523aff7c90 drm/meson: Use drm_mode_get_hv_timing() to populate plane clip rectangle baf88708e38f drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle 8d6797e79d3d drm/imx: Use drm_mode_get_hv_timing() to populate plane clip rectangle 4bd7ff6b606b drm/simple_kms_helper: Use drm_mode_get_hv_timing() to populate plane clip rectangle fc3bc8c17475 drm/arm/mali-dp: Use drm_mode_get_hv_timing() to populate plane clip rectangle 69ec08a135e9 drm/arm/hdlcd: Use drm_mode_get_hv_timing() to populate plane clip rectangle 91f70c943b8f drm/i915: Use drm_mode_get_hv_timing() to populate plane clip rectangle e666a96eb3a0 drm/i915: Reject odd pipe source width with double wide/dual link
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7267/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm: More plane clipping polish
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: More plane clipping polish
URL : https://patchwork.freedesktop.org/series/34323/
State : success
== Summary ==
Test drv_module_reload:
Subgroup basic-no-display:
pass -> DMESG-WARN (shard-hsw) fdo#102707
Test kms_flip:
Subgroup wf_vblank-vs-modeset-interruptible:
pass -> DMESG-WARN (shard-hsw) fdo#102614
Test perf:
Subgroup polling:
fail -> PASS (shard-hsw) fdo#102252
Test kms_setmode:
Subgroup basic:
fail -> PASS (shard-hsw) fdo#99912fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
shard-hsw total:2667 pass:1534 dwarn:3 dfail:0 fail:9 skip:1121 time:9483s shard-snb total:2649 pass:1294 dwarn:1 dfail:0 fail:12 skip:1341 time:7989s
Blacklisted hosts:
shard-apl total:2608 pass:1654 dwarn:1 dfail:0 fail:24 skip:928 time:13276s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_7267/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 52 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
This series first unifies all users of
drm_atomic_helper_check_plane_state()to populate the clip rectangle withdrm_mode_get_hv_timing(), and once everything is unified the clip rectangle handling is sucked intodrm_atomic_helper_check_plane_state()away from driver code.Entire series available here:
git://github.com/vsyrjala/linux.gitatomic_plane_helper_clipCc Archit Taneja <[email protected]>Cc Ben Skeggs <[email protected]>Cc Brian Starkey <[email protected]>Cc CK Hu <[email protected]>Cc Daniel Vetter <[email protected]>Cc Laurent Pinchart <[email protected]>Cc Liviu Dudau <[email protected]>Cc Mali DP Maintainers <[email protected]>Cc Mark Yao <[email protected]>Cc Neil Armstrong <[email protected]>Cc Noralf Trønnes <[email protected]>Cc Philipp Zabel <[email protected]>Cc Rob Clark <[email protected]>Cc Shawn Guo <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thierry Reding <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc VMware Graphics <[email protected]>Ville Syrjälä (15):
drm/i915: Reject odd pipe source width with double wide/dual link drm/i915: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/arm/hdlcd: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/arm/mali-dp: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/simple_kms_helper: Usedrm_mode_get_hv_timing()to populate plane
clip rectangle
drm/imx: Usedrm_mode_get_hv_timing()to populate plane clip rectangle drm/mediatek: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/meson: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/msm/mdp5: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/nouveau/kms/nv50: Usedrm_mode_get_hv_timing()to populate plane
Quoted 8 lines
clip rectangle
drm/rockchip: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/tegra/dc: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/vmwgfx: Usedrm_mode_get_hv_timing()to populate plane clip
rectangle
drm/zte: Usedrm_mode_get_hv_timing()to populate plane clip rectangle
Everything up to here pushed to drm-misc-next. Thanks for the reviews.
There have been a few new users of the clip helper so I'll have to take care of those and respin the final patch.
Also armada looks broken to me since it has started to use the atomic version of the helper without actually being an atomic driver. So I'll have to figure out what's going on there as well.
Quoted 27 lines
drm: Don't pass clip to
drm_atomic_helper_check_plane_state()drivers/gpu/drm/arm/hdlcd_crtc.c | 6 +----- drivers/gpu/drm/arm/malidp_planes.c | 5 +---- drivers/gpu/drm/armada/armada_overlay.c | 2 +- drivers/gpu/drm/drm_atomic_helper.c | 12 +++++++----- drivers/gpu/drm/drm_plane_helper.c | 11 +++-------- drivers/gpu/drm/drm_simple_kms_helper.c | 5 ----- drivers/gpu/drm/i915/intel_atomic_plane.c | 8 -------- drivers/gpu/drm/i915/intel_display.c | 12 +++++++----- drivers/gpu/drm/i915/intel_drv.h | 1 - drivers/gpu/drm/i915/intel_sprite.c | 8 ++++++-- drivers/gpu/drm/imx/ipuv3-plane.c | 7 +------ drivers/gpu/drm/mediatek/mtk_drm_plane.c | 6 +----- drivers/gpu/drm/meson/meson_plane.c | 6 +----- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 14 ++------------ drivers/gpu/drm/nouveau/nv50_display.c | 8 -------- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 8 +------- drivers/gpu/drm/tegra/dc.c | 8 +------- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +------- drivers/gpu/drm/zte/zx_plane.c | 15 +-------------- include/drm/drm_atomic_helper.h | 1 - include/drm/drm_plane_helper.h | 1 - 21 files changed, 35 insertions(+), 117 deletions(-)Signature · 1 line
2.13.6
Signature · 2 lines
Ville Syrjälä Intel OTC