drm: drm_plane_helper_check_state() related stuff
Subsystems (17)
cover drm: drm_plane_helper_check_state() related stuff
From: Ville Syrjälä <[email protected]>
While trawling the tree I spotted some issues with the way vmwgfx uses drm_plane_helper_check_state(). Here's my attempt at fixing it. Do note that I haven't actually tested the resulting code at all, but it does build at least.
And while touching that general area I took up Daniel's suggestion from long ago that drm_plane_helper_check_state() should be renamed and relocated to better reflect its status.
Here's a branch with the entire series:git://github.com/vsyrjala/linux.git atomic_helper_plane_stuff
Ville Syrjälä (5):
drm/vmwgfx: Remove bogus crtc coords vs fb size check drm/vmwgfx: Use drm_plane_helper_check_state() drm/vmwgfx: Try to fix plane clipping
drm: Check crtc_state->enable rather than crtc->enabled in
drm_plane_helper_check_state()
drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
drivers/gpu/drm/arm/hdlcd_crtc.c | 8 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_atomic_helper.c | 95 ++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 111 +++------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 ++- drivers/gpu/drm/i915/intel_display.c | 20 ++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 18 +++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 40 ++++------ drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 5 -- 17 files changed, 187 insertions(+), 183 deletions(-)
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 1/5 drm/vmwgfx: Remove bogus crtc coords vs fb size check
From: Ville Syrjälä <[email protected]>
Throw away the bugs crtc coords vs. fb size check. Crtc coords don't define the viewport inside the fb, that's a job for the src coords, which have been checked by the core already.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +0 -6
@@ -476,12 +476,6 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, vcs =vmw_connector_state_to_vcs (du->connector.state); -if ((dest.x2 > new_fb->width || - dest.y2 > new_fb->height)) { -DRM_ERROR ("CRTC area outside of framebuffer\n" ); -return -EINVAL ; - } -/* Only one active implicit framebuffer at a time. */ mutex_lock (&dev_priv->global_kms_state_mutex); if (vcs->is_implicit && dev_priv->implicit_fb &&
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 1/5] drm/vmwgfx: Remove bogus crtc coords vs fb size check
Quoted 10 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Throw away the bugs crtc coords vs. fb size check. Crtc coords don't define the viewport inside the fb, that's a job for the src coords, which have been checked by the core already.
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 28 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 ------ 1 file changed, 6 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +0
-6@@ -476,12 +476,6 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, vcs =vmw_connector_state_to_vcs (du->connector.state); -if ((dest.x2 > new_fb->width || - dest.y2 > new_fb->height)) { -DRM_ERROR ("CRTC area outside of framebuffer\n" ); -return -EINVAL ; - } -/* Only one active implicit framebuffer at a time. */ mutex_lock (&dev_priv->global_kms_state_mutex); if (vcs->is_implicit && dev_priv->implicit_fb &&Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
Re: [PATCH 1/5] drm/vmwgfx: Remove bogus crtc coords vs fb size check
In reply to Ville SyrjalaHi Ville,
Thank you for the patch.
Quoted 10 lines · On Wednesday, 1 November 2017 20:29:16 EET Ville Syrjala wrote:
From: Ville Syrjälä <[email protected]>
Throw away the bugs crtc coords vs. fb size check. Crtc coords don't define the viewport inside the fb, that's a job for the src coords, which have been checked by the core already.
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 23 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 6 ------ 1 file changed, 6 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.cindex0545740b3724..a4b56699679a100644drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +0
-6@@ -476,12 +476,6 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, vcs =vmw_connector_state_to_vcs (du->connector.state); -if ((dest.x2 > new_fb->width || - dest.y2 > new_fb->height)) { -DRM_ERROR ("CRTC area outside of framebuffer\n" ); -return -EINVAL ; - } -/* Only one active implicit framebuffer at a time. */ mutex_lock (&dev_priv->global_kms_state_mutex);if (
vcs->is_implicit&&dev_priv->implicit_fb&&
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 2/5 drm/vmwgfx: Use drm_plane_helper_check_state()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Atomic drivers have no reason to use drm_plane_helper_check_update() instead of drm_plane_helper_check_state(). So let's switch over.
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3 -14
@@ -442,29 +442,18 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_framebuffer *new_fb = state->fb; -bool visible; - -struct drm_rect src = { - .x1 = state->src_x, - .y1 = state->src_y, - .x2 = state->src_x + state->src_w, - .y2 = state->src_y + state->src_h, - }; -struct drm_rect dest = { +struct drm_rect clip = { .x1 = state->crtc_x, .y1 = state->crtc_y, .x2 = state->crtc_x + state->crtc_w, .y2 = state->crtc_y + state->crtc_h, }; -struct drm_rect clip = dest;int ret; - ret =drm_plane_helper_check_update (plane, state->crtc, new_fb, - &src, &dest, &clip, -DRM_MODE_ROTATE_0 , + ret =drm_plane_helper_check_state (state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , - false, true, &visible); + false, true);if (!ret && new_fb) {
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 2/5] drm/vmwgfx: Use drm_plane_helper_check_state()
Quoted 9 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Atomic drivers have no reason to use
drm_plane_helper_check_update()instead ofdrm_plane_helper_check_state(). So let's switch over.Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
I think the new atomic helper landed at about the same time vmwgfx landed, hence why it wasn't converted.
Quoted 48 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3
-14@@ -442,29 +442,18 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_framebuffer *new_fb = state->fb; -bool visible; - -struct drm_rect src = { - .x1 = state->src_x, - .y1 = state->src_y, - .x2 = state->src_x + state->src_w, - .y2 = state->src_y + state->src_h, - }; -struct drm_rect dest = { +struct drm_rect clip = { .x1 = state->crtc_x, .y1 = state->crtc_y, .x2 = state->crtc_x + state->crtc_w, .y2 = state->crtc_y + state->crtc_h, }; -struct drm_rect clip = dest;int ret; - ret =drm_plane_helper_check_update (plane, state->crtc, new_fb, - &src, &dest, &clip, -DRM_MODE_ROTATE_0 , + ret =drm_plane_helper_check_state (state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , - false, true, &visible); + false, true);if (!ret && new_fb) {Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
Re: [PATCH 2/5] drm/vmwgfx: Use drm_plane_helper_check_state()
In reply to Ville SyrjalaHi Ville,
Thank you for the patch.
Quoted 9 lines · On Wednesday, 1 November 2017 20:29:17 EET Ville Syrjala wrote:
From: Ville Syrjälä <[email protected]>
Atomic drivers have no reason to use
drm_plane_helper_check_update()instead ofdrm_plane_helper_check_state(). So let's switch over.Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 42 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.cindexa4b56699679a..515b67783a41100644drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +3
-14@@ -442,29 +442,18 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, struct drm_plane_state *state) {struct drm_framebuffer *new_fb = state->fb; -bool visible; - -struct drm_rect src = { - .x1 = state->src_x, - .y1 = state->src_y, - .x2 = state->src_x + state->src_w, - .y2 = state->src_y + state->src_h, - }; -struct drm_rect dest = { +struct drm_rect clip = { .x1 = state->crtc_x, .y1 = state->crtc_y, .x2 = state->crtc_x + state->crtc_w, .y2 = state->crtc_y + state->crtc_h, }; -struct drm_rect clip = dest;int ret; - ret =drm_plane_helper_check_update (plane, state->crtc, new_fb, - &src, &dest, &clip, -DRM_MODE_ROTATE_0 , + ret =drm_plane_helper_check_state (state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , - false, true, &visible); + false, true);if (!ret && new_fb) {
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 3/5 drm/vmwgfx: Try to fix plane clipping
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
Try to fix the code to actually clip the plane to the crtc bounds instead of the user provided crtc coordinates (which would be a no-op since those are exactly the coordinates before clipping).
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +13 -10
@@ -441,20 +441,23 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,int vmw_du_primary_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { +struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = { - .x1 = state->crtc_x, - .y1 = state->crtc_y, - .x2 = state->crtc_x + state->crtc_w, - .y2 = state->crtc_y + state->crtc_h, - }; +struct drm_rect clip = {};int ret; - ret =drm_plane_helper_check_state (state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +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; + } + + ret =drm_plane_helper_check_state (state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;
Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH 3/5] drm/vmwgfx: Try to fix plane clipping
Quoted 10 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Try to fix the code to actually clip the plane to the crtc bounds instead of the user provided crtc coordinates (which would be a no-op since those are exactly the coordinates before clipping).
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
I kinda wonder whether we shouldn't push this down into the helper ...
Either way, Reviewed-by: Daniel Vetter <[email protected]>
Quoted 49 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +13
-10@@ -441,20 +441,23 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,int vmw_du_primary_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { +struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = { - .x1 = state->crtc_x, - .y1 = state->crtc_y, - .x2 = state->crtc_x + state->crtc_w, - .y2 = state->crtc_y + state->crtc_h, - }; +struct drm_rect clip = {};int ret; - ret =drm_plane_helper_check_state (state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +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; + } + + ret =drm_plane_helper_check_state (state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
Re: [PATCH 3/5] drm/vmwgfx: Try to fix plane clipping
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Try to fix the code to actually clip the plane to the crtc bounds instead of the user provided crtc coordinates (which would be a no-op since those are exactly the coordinates before clipping).
Quoted 6 lines
Quoted 4 lines
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>I kinda wonder whether we shouldn't push this down into the helper ...
Would require quite going through all drivers making sure they are happy with using the adjusted_mode.crtc_ timings. I think most drivers use the other adjusted_mode timings currently, and some even use the user mode timings (which could be an actual bug).
Quoted 57 lines
Either way, Reviewed-by: Daniel Vetter <[email protected]>
Quoted 49 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +13
-10@@ -441,20 +441,23 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,int vmw_du_primary_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { +struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = { - .x1 = state->crtc_x, - .y1 = state->crtc_y, - .x2 = state->crtc_x + state->crtc_w, - .y2 = state->crtc_y + state->crtc_h, - }; +struct drm_rect clip = {};int ret; - ret =drm_plane_helper_check_state (state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +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; + } + + ret =drm_plane_helper_check_state (state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH 3/5] drm/vmwgfx: Try to fix plane clipping
Quoted 13 lines · Ville Syrjälä
Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Try to fix the code to actually clip the plane to the crtc bounds instead of the user provided crtc coordinates (which would be a no-op since those are exactly the coordinates before clipping).
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
Quoted 6 lines
Quoted 1 line
I kinda wonder whether we shouldn't push this down into the helper ...
Would require quite going through all drivers making sure they are happy with using the adjusted_mode.crtc_ timings. I think most drivers use the other
adjusted_modetimings currently, and some even use the user mode timings (which could be an actual bug).
Let me take that back. What we want is to clip to the user mode timings. Stereo 3D needs the special treatment from drm_mode_get_hv_timing(). I'm getting confused by all these different timings we have all over the place.
I think for i915 all we would need is to change the double wide/dual link adjustent for pipe_src_w to simply reject odd widths instead. That would guarantee that the user mode timings match the pipe_src_w/h 100%.
For the other driver we'd need to figure out why they're using adjusted_mode timings for clipping. I guess that's just a mistake, which I repeated here with vmwgfx after getting confused by looking at the other drivers.
I guess I just volunteered myself to do this. Just needs plenty of acks from driver maintainers I suppose.
Quoted 66 lines
Quoted 58 lines
Either way, Reviewed-by: Daniel Vetter <[email protected]>
Quoted 49 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +13
-10@@ -441,20 +441,23 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,int vmw_du_primary_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { +struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = { - .x1 = state->crtc_x, - .y1 = state->crtc_y, - .x2 = state->crtc_x + state->crtc_w, - .y2 = state->crtc_y + state->crtc_h, - }; +struct drm_rect clip = {};int ret; - ret =drm_plane_helper_check_state (state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +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; + } + + ret =drm_plane_helper_check_state (state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 3/5] drm/vmwgfx: Try to fix plane clipping
Quoted 31 lines · Ville Syrjälä
Quoted 13 lines · Ville Syrjälä
Quoted 12 lines · Daniel Vetter
Quoted 10 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Try to fix the code to actually clip the plane to the crtc bounds instead of the user provided crtc coordinates (which would be a no-op since those are exactly the coordinates before clipping).
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>Quoted 6 lines
Quoted 1 line
I kinda wonder whether we shouldn't push this down into the helper ...
Would require quite going through all drivers making sure they are happy with using the adjusted_mode.crtc_ timings. I think most drivers use the other
adjusted_modetimings currently, and some even use the user mode timings (which could be an actual bug).Let me take that back. What we want is to clip to the user mode timings. Stereo 3D needs the special treatment from
drm_mode_get_hv_timing(). I'm getting confused by all these different timings we have all over the place.I think for i915 all we would need is to change the double wide/dual link adjustent for
pipe_src_wto simply reject odd widths instead. That would guarantee that the user mode timings match the pipe_src_w/h 100%.
Quoted 7 lines
For the other driver we'd need to figure out why they're using
adjusted_modetimings for clipping. I guess that's just a mistake, which I repeated here with vmwgfx after getting confused by looking at the other drivers.I guess I just volunteered myself to do this. Just needs plenty of acks from driver maintainers I suppose.
Yeah consistently using drm_mode_get_hv_timing from crtc_state->requested_mode seems like the right thing to do. Otherwise there's a driver bug lurking somewhere ...
-Daniel
Quoted 71 lines
Quoted 67 lines
Quoted 59 lines
Either way, Reviewed-by: Daniel Vetter <[email protected]>
Quoted 49 lines
--- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-)drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +13
-10@@ -441,20 +441,23 @@ vmw_du_cursor_plane_atomic_update(struct drm_plane *plane,int vmw_du_primary_plane_atomic_check (struct drm_plane *plane,struct drm_plane_state *state) { +struct drm_crtc_state *crtc_state =NULL ;struct drm_framebuffer *new_fb = state->fb; -struct drm_rect clip = { - .x1 = state->crtc_x, - .y1 = state->crtc_y, - .x2 = state->crtc_x + state->crtc_w, - .y2 = state->crtc_y + state->crtc_h, - }; +struct drm_rect clip = {};int ret; - ret =drm_plane_helper_check_state (state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +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; + } + + ret =drm_plane_helper_check_state (state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-develSignature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.chSignature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfxSignature · 2 lines
Ville Syrjälä Intel OTC
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
Re: [Intel-gfx] [PATCH 3/5] drm/vmwgfx: Try to fix plane clipping
In reply to Ville SyrjäläHi Ville,
Quoted 9 lines · On Monday, 6 November 2017 20:04:38 EET Ville Syrjälä wrote:
Quoted 8 lines · Ville Syrjälä
Quoted 7 lines · Daniel Vetter
Quoted 6 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
Try to fix the code to actually clip the plane to the crtc bounds instead of the user provided crtc coordinates (which would be a no-op since those are exactly the coordinates before clipping).
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 4 lines
Cc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>I kinda wonder whether we shouldn't push this down into the helper ...
I think that would be nice.
Quoted 15 lines
Quoted 4 lines
Would require quite going through all drivers making sure they are happy with using the adjusted_mode.crtc_ timings. I think most drivers use the other
adjusted_modetimings currently, and some even use the user mode timings (which could be an actual bug).Let me take that back. What we want is to clip to the user mode timings. Stereo 3D needs the special treatment from
drm_mode_get_hv_timing(). I'm getting confused by all these different timings we have all over the place.I think for i915 all we would need is to change the double wide/dual link adjustent for
pipe_src_wto simply reject odd widths instead. That would guarantee that the user mode timings match the pipe_src_w/h 100%.
Quoted 4 lines
For the other driver we'd need to figure out why they're using
adjusted_modetimings for clipping. I guess that's just a mistake, which I repeated here with vmwgfx after getting confused by looking at the other drivers.
I suppose it's a mix of cargo-cult and the fact that adjusted_mode hints that it contains the timings that should be applied to the hardware. That's why I use it in rcar-du.
Are drivers allowed to adjust the hdisplay and vdisplay values though ? I thought unsupported values there had to be rejected with an error at atomic check time, not adjusted.
Quoted 2 lines
I guess I just volunteered myself to do this. Just needs plenty of acks from driver maintainers I suppose.
I'll review and test the rcar-du patch :-)
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 4/5 drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state()
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
drm_plane_helper_check_state() is supposed to do things the atomic way, so it should not be inspecting crtc->enabled. Rather we should be looking at crtc_state->enable.
We have a slight complication due to drm_plane_helper_check_update() reusing drm_plane_helper_check_state() for non-atomic drivers. Thus we'll have to pass the crtc_state in manally and construct a fake crtc_state in drm_plane_helper_check_update().
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_plane_helper.c | 52 +++++++++++++++++------------ drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 +-- drivers/gpu/drm/nouveau/nv50_display.c | 6 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/tegra/dc.c | 4 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/zte/zx_plane.c | 4 +-- include/drm/drm_plane_helper.h | 3 +- 15 files changed, 53 insertions(+), 39 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +1 -1
@@ -252,7 +252,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/arm/malidp_planes.c +2 -1
@@ -150,7 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;
drivers/gpu/drm/drm_plane_helper.c +30 -22
113 lines not on this page · raw message
drivers/gpu/drm/drm_simple_kms_helper.c +1 -1
@@ -103,7 +103,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, &clip, + ret =drm_plane_helper_check_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 +2 -0
@@ -9317,6 +9317,7 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state,int ret; ret = drm_plane_helper_check_state(&plane_state->base, + &crtc_state->base, &plane_state->clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,
@@ -12808,6 +12809,7 @@ intel_check_primary_plane(struct intel_plane *plane, } ret =drm_plane_helper_check_state (&state->base, + &crtc_state->base, &state->clip, min_scale, max_scale, can_position, true);
drivers/gpu/drm/imx/ipuv3-plane.c +1 -1
@@ -342,7 +342,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -1
@@ -111,7 +111,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
drivers/gpu/drm/meson/meson_plane.c +1 -1
@@ -61,7 +61,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2 -2
@@ -348,8 +348,8 @@ 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 ); - ret =drm_plane_helper_check_state (state, &clip, min_scale, - max_scale, true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, + min_scale, max_scale, true, true);if (ret)return ret;
drivers/gpu/drm/nouveau/nv50_display.c +4 -2
@@ -1143,7 +1143,8 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, {int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
@@ -1432,7 +1433,8 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,if (!fb->format->depth)return -EINVAL ; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1 -1
@@ -659,7 +659,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip, min_scale, max_scale, true, true);if (ret)
drivers/gpu/drm/tegra/dc.c +2 -2
@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , - true, true); + err =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -1
@@ -454,7 +454,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/zte/zx_plane.c +2 -2
@@ -80,7 +80,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip, min_scale, max_scale, true, true); }
@@ -315,7 +315,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
include/drm/drm_plane_helper.h +2 -1
@@ -38,7 +38,8 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_state(struct drm_plane_state *state, +int drm_plane_helper_check_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,
Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 4/5 drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state()
From: Ville Syrjälä <[email protected]>
drm_plane_helper_check_state() is supposed to do things the atomic way, so it should not be inspecting crtc->enabled. Rather we should be looking at crtc_state->enable.
We have a slight complication due to drm_plane_helper_check_update() reusing drm_plane_helper_check_state() for non-atomic drivers. Thus we'll have to pass the crtc_state in manally and construct a fake crtc_state in drm_plane_helper_check_update().
v2: Fix the WARNs about plane_state->crtc matching crtc_state->crtc
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_plane_helper.c | 51 ++++++++++++++++------------- drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 +-- drivers/gpu/drm/nouveau/nv50_display.c | 6 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/tegra/dc.c | 4 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/zte/zx_plane.c | 4 +-- include/drm/drm_plane_helper.h | 3 +- 15 files changed, 52 insertions(+), 39 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +1 -1
@@ -252,7 +252,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/arm/malidp_planes.c +2 -1
@@ -150,7 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;
drivers/gpu/drm/drm_plane_helper.c +29 -22
112 lines not on this page · raw message
drivers/gpu/drm/drm_simple_kms_helper.c +1 -1
@@ -103,7 +103,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, &clip, + ret =drm_plane_helper_check_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 +2 -0
@@ -9317,6 +9317,7 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state,int ret; ret = drm_plane_helper_check_state(&plane_state->base, + &crtc_state->base, &plane_state->clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,
@@ -12808,6 +12809,7 @@ intel_check_primary_plane(struct intel_plane *plane, } ret =drm_plane_helper_check_state (&state->base, + &crtc_state->base, &state->clip, min_scale, max_scale, can_position, true);
drivers/gpu/drm/imx/ipuv3-plane.c +1 -1
@@ -342,7 +342,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);
drivers/gpu/drm/mediatek/mtk_drm_plane.c +1 -1
@@ -111,7 +111,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
drivers/gpu/drm/meson/meson_plane.c +1 -1
@@ -61,7 +61,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2 -2
@@ -348,8 +348,8 @@ 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 ); - ret =drm_plane_helper_check_state (state, &clip, min_scale, - max_scale, true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, + min_scale, max_scale, true, true);if (ret)return ret;
drivers/gpu/drm/nouveau/nv50_display.c +4 -2
@@ -1143,7 +1143,8 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, {int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);
@@ -1432,7 +1433,8 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,if (!fb->format->depth)return -EINVAL ; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1 -1
@@ -659,7 +659,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip, min_scale, max_scale, true, true);if (ret)
drivers/gpu/drm/tegra/dc.c +2 -2
@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , - true, true); + err =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1 -1
@@ -454,7 +454,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
drivers/gpu/drm/zte/zx_plane.c +2 -2
@@ -80,7 +80,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip, min_scale, max_scale, true, true); }
@@ -315,7 +315,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);
include/drm/drm_plane_helper.h +2 -1
@@ -38,7 +38,8 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_state(struct drm_plane_state *state, +int drm_plane_helper_check_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,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH v2 4/5] drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state()
Quoted 5 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
drm_plane_helper_check_state()is supposed to do things the atomic way, so it should not be inspectingcrtc->enabled. Rather we should be looking atcrtc_state->enable.
Oh dear, how often are those legacy state thingies going to hurt us :-/
Quoted 8 lines
We have a slight complication due to
drm_plane_helper_check_update()reusingdrm_plane_helper_check_state()for non-atomic drivers. Thus we'll have to pass thecrtc_statein manally and construct a fakecrtc_stateindrm_plane_helper_check_update().v2: Fix the WARNs about
plane_state->crtcmatchingcrtc_state->crtcSigned-off-by Ville Syrjälä <[email protected]>
I guess even more reasons to drop the clip rectangle and just look at crtc_state?
Anyway, this looks good to me.
Quoted 361 lines
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_plane_helper.c | 51 ++++++++++++++++------------- drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 +-- drivers/gpu/drm/nouveau/nv50_display.c | 6 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/tegra/dc.c | 4 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/zte/zx_plane.c | 4 +-- include/drm/drm_plane_helper.h | 3 +- 15 files changed, 52 insertions(+), 39 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +1
-1@@ -252,7 +252,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/arm/malidp_planes.c +2
-1@@ -150,7 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;drivers/gpu/drm/drm_plane_helper.c +29
-22@@ -101,7 +101,8 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,/** * drm_plane_helper_check_state() - Check plane state for validity -* @state: plane state to check +* @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 @@ -120,35 +121,37 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,* RETURNS: * Zero if update appears valid, error code on failure */ -int drm_plane_helper_check_state (struct drm_plane_state *state, +int drm_plane_helper_check_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,bool can_update_disabled) { -struct drm_crtc *crtc = state->crtc; -struct drm_framebuffer *fb = state->fb; -struct drm_rect *src = &state->src; -struct drm_rect *dst = &state->dst; -unsigned int rotation = state->rotation; +struct drm_framebuffer *fb = plane_state->fb; +struct drm_rect *src = &plane_state->src; +struct drm_rect *dst = &plane_state->dst; +unsigned int rotation = plane_state->rotation;int hscale, vscale; - *src =drm_plane_state_src (state); - *dst =drm_plane_state_dest (state); +WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc); + + *src =drm_plane_state_src (plane_state); + *dst =drm_plane_state_dest (plane_state);if (!fb) { - state->visible = false; + plane_state->visible = false;return 0 ; }/* crtc should only be NULL when disabling (i.e., !fb) */ -if (WARN_ON (!crtc)) { - state->visible = false; +if (WARN_ON (!plane_state->crtc)) { + plane_state->visible = false;return 0 ; } -if (!crtc->enabled && !can_update_disabled) { +if (!crtc_state->enable && !can_update_disabled) {DRM_DEBUG_KMS ("Cannot update plane of a disabled CRTC.\n" );return -EINVAL ; }@@ -160,16 +163,16 @@ int drm_plane_helper_check_state(struct drm_plane_state *state, vscale =drm_rect_calc_vscale (src, dst, min_scale, max_scale);if (hscale <0 || vscale <0 ) {DRM_DEBUG_KMS ("Invalid scaling of plane\n" ); -drm_rect_debug_print ("src: " , &state->src, true); -drm_rect_debug_print ("dst: " , &state->dst, false); +drm_rect_debug_print ("src: " , &plane_state->src, true); +drm_rect_debug_print ("dst: " , &plane_state->dst, false);return -ERANGE ; } - state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); + plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale);drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation); -if (!state->visible) +if (!plane_state->visible)/* * Plane isn't visible; some drivers can handle this * so we just return success here. Drivers that can't @@ -230,7 +233,7 @@ int drm_plane_helper_check_update(struct drm_plane *plane, bool can_update_disabled, bool *visible) { - struct drm_plane_state state = { + struct drm_plane_state plane_state = { .plane = plane, .crtc = crtc, .fb = fb,@@ -245,18 +248,22 @@ int drm_plane_helper_check_update(struct drm_plane *plane, .rotation = rotation, .visible = *visible, }; +struct drm_crtc_state crtc_state = { + .crtc = crtc, + .enable = crtc->enabled, + };int ret; - ret =drm_plane_helper_check_state (&state, clip, + ret =drm_plane_helper_check_state (&plane_state, &crtc_state, clip, min_scale, max_scale, can_position, can_update_disabled);if (ret)return ret; - *src = state.src; - *dst = state.dst; - *visible = state.visible; + *src = plane_state.src; + *dst = plane_state.dst; + *visible = plane_state.visible;return 0 ; }drivers/gpu/drm/drm_simple_kms_helper.c +1
-1@@ -103,7 +103,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, &clip, + ret =drm_plane_helper_check_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 +2
-0@@ -9317,6 +9317,7 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state,int ret; ret = drm_plane_helper_check_state(&plane_state->base, + &crtc_state->base, &plane_state->clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,@@ -12808,6 +12809,7 @@ intel_check_primary_plane(struct intel_plane *plane, } ret =drm_plane_helper_check_state (&state->base, + &crtc_state->base, &state->clip, min_scale, max_scale, can_position, true);drivers/gpu/drm/imx/ipuv3-plane.c +1
-1@@ -342,7 +342,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);drivers/gpu/drm/mediatek/mtk_drm_plane.c +1
-1@@ -111,7 +111,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/meson/meson_plane.c +1
-1@@ -61,7 +61,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-2@@ -348,8 +348,8 @@ 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 ); - ret =drm_plane_helper_check_state (state, &clip, min_scale, - max_scale, true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, + min_scale, max_scale, true, true);if (ret)return ret;drivers/gpu/drm/nouveau/nv50_display.c +4
-2@@ -1143,7 +1143,8 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, {int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -1432,7 +1433,8 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,if (!fb->format->depth)return -EINVAL ; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-1@@ -659,7 +659,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/tegra/dc.c +2
-2@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , - true, true); + err =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-1@@ -454,7 +454,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/zte/zx_plane.c +2
-2@@ -80,7 +80,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip, min_scale, max_scale, true, true); }@@ -315,7 +315,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);include/drm/drm_plane_helper.h +2
-1@@ -38,7 +38,8 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_state(struct drm_plane_state *state, +int drm_plane_helper_check_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,Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
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
Re: [PATCH 4/5] drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state()
In reply to Ville SyrjalaHi Ville,
Thank you for the patch.
Quoted 10 lines · On Wednesday, 1 November 2017 20:29:19 EET Ville Syrjala wrote:
From: Ville Syrjälä <[email protected]>
drm_plane_helper_check_state()is supposed to do things the atomic way, so it should not be inspectingcrtc->enabled. Rather we should be looking atcrtc_state->enable.We have a slight complication due to
drm_plane_helper_check_update()reusingdrm_plane_helper_check_state()for non-atomic drivers. Thus we'll have to pass thecrtc_statein manally and construct a fakecrtc_stateindrm_plane_helper_check_update().
The only user of drm_plane_helper_check_update() apart from vmwgfx which you converted in patch 2/5 is the armada driver. It would be nice to convert it to atomic modesetting and drop this function :-) At the very least, I'd add a comment to drm_plane_helper_check_update() that this change should be reverted when the function is dropped, otherwise we'll carry the CRTC state argument for a long time without realizing it's not needed anymore.
Apart from that,
Quoted 370 lines
Signed-off-by Ville Syrjälä <[email protected]>--- drivers/gpu/drm/arm/hdlcd_crtc.c | 2 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_plane_helper.c | 52 ++++++++++++++------------ drivers/gpu/drm/drm_simple_kms_helper.c | 2 +- drivers/gpu/drm/i915/intel_display.c | 2 ++ drivers/gpu/drm/imx/ipuv3-plane.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- drivers/gpu/drm/meson/meson_plane.c | 2 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 4 +-- drivers/gpu/drm/nouveau/nv50_display.c | 6 ++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +- drivers/gpu/drm/tegra/dc.c | 4 +-- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 2 +- drivers/gpu/drm/zte/zx_plane.c | 4 +-- include/drm/drm_plane_helper.h | 3 +- 15 files changed, 53 insertions(+), 39 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/arm/hdlcd_crtc.cindex72b22b805412..14721723fa8a100644drivers/gpu/drm/arm/hdlcd_crtc.c +1
-1@@ -252,7 +252,7 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);(quoted diff) +0
-0
b/drivers/gpu/drm/arm/malidp_planes.cindex94e7e3fa3408..492d99dd55d4100644drivers/gpu/drm/arm/malidp_planes.c +2
-1@@ -150,7 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/drm_plane_helper.cindex759ed93f4ba8..adb8d94484f2100644drivers/gpu/drm/drm_plane_helper.c +2
-1@@ -101,7 +101,8 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc,/** * drm_plane_helper_check_state() - Check plane state for validity -* @state: plane state to check +* @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
drivers/gpu/drm/drm_plane_helper.c +19
-16@@ -120,35 +121,38 @@ static int get_connectors_for_crtc(struct drm_crtc*crtc, * RETURNS: * Zero if update appears valid, error code on failure */ -int drm_plane_helper_check_state (struct drm_plane_state *state, +int drm_plane_helper_check_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,bool can_update_disabled) { -struct drm_crtc *crtc = state->crtc; -struct drm_framebuffer *fb = state->fb; -struct drm_rect *src = &state->src; -struct drm_rect *dst = &state->dst; -unsigned int rotation = state->rotation; +struct drm_framebuffer *fb = plane_state->fb; +struct drm_rect *src = &plane_state->src; +struct drm_rect *dst = &plane_state->dst; +unsigned int rotation = plane_state->rotation;int hscale, vscale; - *src =drm_plane_state_src (state); - *dst =drm_plane_state_dest (state); +WARN_ON (!crtc_state != !plane_state->crtc); +WARN_ON (crtc_state && crtc_state->crtc != plane_state->crtc); + + *src =drm_plane_state_src (plane_state); + *dst =drm_plane_state_dest (plane_state);if (!fb) { - state->visible = false; + plane_state->visible = false;return 0 ; }/* crtc should only be NULL when disabling (i.e., !fb) */ -if (WARN_ON (!crtc)) { - state->visible = false; +if (WARN_ON (!plane_state->crtc)) { + plane_state->visible = false;return 0 ; } -if (!crtc->enabled && !can_update_disabled) { +if (!crtc_state->enable && !can_update_disabled) {DRM_DEBUG_KMS ("Cannot update plane of a disabled CRTC.\n" );return -EINVAL ; }@@ -160,16 +164,16 @@ int drm_plane_helper_check_state(structdrm_plane_state *state, vscale =drm_rect_calc_vscale (src, dst, min_scale, max_scale);if (hscale <0 || vscale <0 ) {DRM_DEBUG_KMS ("Invalid scaling of plane\n" ); -drm_rect_debug_print ("src: " , &state->src, true); -drm_rect_debug_print ("dst: " , &state->dst, false); +drm_rect_debug_print ("src: " , &plane_state->src, true); +drm_rect_debug_print ("dst: " , &plane_state->dst, false);return -ERANGE ; } - state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); + plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale);drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation); -if (!state->visible) +if (!plane_state->visible)/* drivers/gpu/drm/drm_plane_helper.c +9
-5* Plane isn't visible; some drivers can handle this * so we just return success here. Drivers that can't @@ -230,7 +234,7 @@ int drm_plane_helper_check_update(struct drm_plane *plane, bool can_update_disabled, bool *visible) { -struct drm_plane_state state = { +struct drm_plane_state plane_state = { .plane = plane, .crtc = crtc, .fb = fb,@@ -245,18 +249,22 @@ int drm_plane_helper_check_update(struct drm_plane *plane, .rotation = rotation, .visible = *visible, }; +struct drm_crtc_state crtc_state = { + .crtc = crtc, + .enable = crtc->enabled, + };int ret; - ret =drm_plane_helper_check_state (&state, clip, + ret =drm_plane_helper_check_state (&plane_state, &crtc_state, clip, min_scale, max_scale, can_position, can_update_disabled);if (ret)return ret; - *src = state.src; - *dst = state.dst; - *visible = state.visible; + *src = plane_state.src; + *dst = plane_state.dst; + *visible = plane_state.visible;return 0 ; }(quoted diff) +0
-0
b/drivers/gpu/drm/drm_simple_kms_helper.cindexdc9fd109de14..d428c805025c100644drivers/gpu/drm/drm_simple_kms_helper.c +1
-1@@ -103,7 +103,7 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, &clip, + ret =drm_plane_helper_check_state (plane_state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_display.cindex737de251d0f8..4a459726b36b100644drivers/gpu/drm/i915/intel_display.c +2
-0@@ -9317,6 +9317,7 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, int ret; ret = drm_plane_helper_check_state(&plane_state->base, + &crtc_state->base, &plane_state->clip, DRM_PLANE_HELPER_NO_SCALING, DRM_PLANE_HELPER_NO_SCALING,@@ -12808,6 +12809,7 @@ intel_check_primary_plane(struct intel_plane *plane, } ret =drm_plane_helper_check_state (&state->base, + &crtc_state->base, &state->clip, min_scale, max_scale, can_position, true);(quoted diff) +0
-0
b/drivers/gpu/drm/imx/ipuv3-plane.cindex247c60e6bed2..51b23ac175e3100644drivers/gpu/drm/imx/ipuv3-plane.c +1
-1@@ -342,7 +342,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , can_position, true);(quoted diff) +0
-0
b/drivers/gpu/drm/mediatek/mtk_drm_plane.cindex6f121891430f..7ebb33657704100644drivers/gpu/drm/mediatek/mtk_drm_plane.c +1
-1@@ -111,7 +111,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);(quoted diff) +0
-0
b/drivers/gpu/drm/meson/meson_plane.cindex17e96fa47868..2a00b720c371100644drivers/gpu/drm/meson/meson_plane.c +1
-1@@ -61,7 +61,7 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, &clip, +return drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);(quoted diff) +0
-0
b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.cindex4b22ac3413a1..1c194a9453d9100644drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +2
-2@@ -348,8 +348,8 @@ static int mdp5_plane_atomic_check_with_state(structdrm_crtc_state *crtc_state, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); - ret =drm_plane_helper_check_state (state, &clip, min_scale, - max_scale, true, true); + ret =drm_plane_helper_check_state (state, crtc_state, &clip, + min_scale, max_scale, true, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/nouveau/nv50_display.cindexe4751f92b342..7f11a88d0593100644drivers/gpu/drm/nouveau/nv50_display.c +4
-2@@ -1143,7 +1143,8 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, { int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , true, true);@@ -1432,7 +1433,8 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, if (!fb->format->depth) return -EINVAL; - ret =drm_plane_helper_check_state (&asyw->state, &asyw->clip, + ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, + &asyw->clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);(quoted diff) +0
-0
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.cindex19128b4dea54..36d0f101e30d100644drivers/gpu/drm/rockchip/rockchip_drm_vop.c +1
-1@@ -659,7 +659,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip, min_scale, max_scale, true, true);if (ret)drivers/gpu/drm/tegra/dc.c +2
-2@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, &clip,0 ,INT_MAX , - true, true); + err =drm_plane_helper_check_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;(quoted diff) +0
-0
b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.cindexefa41c086198..d95e7b1c3b11100644drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +1
-1@@ -454,7 +454,7 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, &clip, + ret =drm_plane_helper_check_state (state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);drivers/gpu/drm/zte/zx_plane.c +2
-2@@ -80,7 +80,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip, min_scale, max_scale, true, true); }@@ -315,7 +315,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, &clip, +return drm_plane_helper_check_state (plane_state, crtc_state, &clip,DRM_PLANE_HELPER_NO_SCALING ,DRM_PLANE_HELPER_NO_SCALING , false, true);include/drm/drm_plane_helper.h +2
-1@@ -38,7 +38,8 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_state(struct drm_plane_state *state, +int drm_plane_helper_check_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,
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH 5/5 drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
In reply to Ville SyrjalaFrom: Ville Syrjälä <[email protected]>
drm_plane_helper_check_update() isn't a transitional helper, so let's rename it to drm_atomic_helper_check_plane_state() and move it into drm_atomic_helper.c.
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 8 +-- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 95 +++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 103 ++-------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 +-- drivers/gpu/drm/i915/intel_display.c | 22 +++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +-- drivers/gpu/drm/meson/meson_plane.c | 8 +-- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 20 +++--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +-- drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 6 -- 17 files changed, 170 insertions(+), 166 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +4 -4
@@ -252,10 +252,10 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); } static void hdlcd_plane_atomic_update(struct drm_plane *plane,
drivers/gpu/drm/arm/malidp_planes.c +2 -2
@@ -150,8 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;
drivers/gpu/drm/drm_atomic_helper.c +95 -0
101 lines not on this page · raw message
drivers/gpu/drm/drm_plane_helper.c +4 -99
115 lines not on this page · raw message
drivers/gpu/drm/drm_simple_kms_helper.c +5 -4
@@ -103,10 +103,11 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;
drivers/gpu/drm/i915/intel_display.c +11 -11
@@ -9316,12 +9316,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state,u32 offset;int ret; - ret =drm_plane_helper_check_state (&plane_state->base, - &crtc_state->base, - &plane_state->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&plane_state->base, + &crtc_state->base, + &plane_state->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true);if (ret)return ret;
@@ -12808,11 +12808,11 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } - ret =drm_plane_helper_check_state (&state->base, - &crtc_state->base, - &state->clip, - min_scale, max_scale, - can_position, true); + ret =drm_atomic_helper_check_plane_state (&state->base, + &crtc_state->base, + &state->clip, + min_scale, max_scale, + can_position, true);if (ret)return ret;
drivers/gpu/drm/imx/ipuv3-plane.c +4 -4
@@ -342,10 +342,10 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - can_position, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + can_position, true);if (ret)return ret;
drivers/gpu/drm/mediatek/mtk_drm_plane.c +4 -4
@@ -111,10 +111,10 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); } static void mtk_plane_atomic_update(struct drm_plane *plane,
drivers/gpu/drm/meson/meson_plane.c +4 -4
@@ -61,10 +61,10 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); }/* Takes a fixed 16.16 number and converts it to integer. */
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +3 -2
@@ -348,8 +348,9 @@ 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 ); - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;
drivers/gpu/drm/nouveau/nv50_display.c +10 -10
@@ -1143,11 +1143,11 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, {int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); asyh->curs.visible = asyw->state.visible;if (ret || !asyh->curs.visible)return ret;
@@ -1433,11 +1433,11 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,if (!fb->format->depth)return -EINVAL ; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +3 -3
@@ -659,9 +659,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, - true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;
drivers/gpu/drm/tegra/dc.c +2 -2
@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 -4
@@ -454,10 +454,10 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;
drivers/gpu/drm/zte/zx_plane.c +8 -7
@@ -80,9 +80,9 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, - min_scale, max_scale, - true, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, min_scale, max_scale, + true, true); }static int zx_vl_get_fmt (uint32_t format)
@@ -315,10 +315,11 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); }static int zx_gl_get_fmt (uint32_t format)
include/drm/drm_atomic_helper.h +7 -0
@@ -38,6 +38,13 @@ struct drm_private_state;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, +bool can_update_disabled);int drm_atomic_helper_check_planes (struct drm_device *dev,struct drm_atomic_state *state); int drm_atomic_helper_check(struct drm_device *dev,
include/drm/drm_plane_helper.h +0 -6
@@ -38,12 +38,6 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_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, -bool can_update_disabled); int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,
Signature · 6 lines
2.13.6 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 5/5 drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
From: Ville Syrjälä <[email protected]>
drm_plane_helper_check_update() isn't a transitional helper, so let's rename it to drm_atomic_helper_check_plane_state() and move it into drm_atomic_helper.c.
v2: Fix the WARNs about plane_state->crtc matching crtc_state->crtc
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 8 +-- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 94 +++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 102 ++-------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 +-- drivers/gpu/drm/i915/intel_display.c | 22 +++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +-- drivers/gpu/drm/meson/meson_plane.c | 8 +-- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 20 +++--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +-- drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 6 -- 17 files changed, 169 insertions(+), 165 deletions(-)
drivers/gpu/drm/arm/hdlcd_crtc.c +4 -4
@@ -252,10 +252,10 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); } static void hdlcd_plane_atomic_update(struct drm_plane *plane,
drivers/gpu/drm/arm/malidp_planes.c +2 -2
@@ -150,8 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;
drivers/gpu/drm/drm_atomic_helper.c +94 -0
100 lines not on this page · raw message
drivers/gpu/drm/drm_plane_helper.c +4 -98
114 lines not on this page · raw message
drivers/gpu/drm/drm_simple_kms_helper.c +5 -4
@@ -103,10 +103,11 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;
drivers/gpu/drm/i915/intel_display.c +11 -11
@@ -9316,12 +9316,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state,u32 offset;int ret; - ret =drm_plane_helper_check_state (&plane_state->base, - &crtc_state->base, - &plane_state->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&plane_state->base, + &crtc_state->base, + &plane_state->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true);if (ret)return ret;
@@ -12808,11 +12808,11 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } - ret =drm_plane_helper_check_state (&state->base, - &crtc_state->base, - &state->clip, - min_scale, max_scale, - can_position, true); + ret =drm_atomic_helper_check_plane_state (&state->base, + &crtc_state->base, + &state->clip, + min_scale, max_scale, + can_position, true);if (ret)return ret;
drivers/gpu/drm/imx/ipuv3-plane.c +4 -4
@@ -342,10 +342,10 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - can_position, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + can_position, true);if (ret)return ret;
drivers/gpu/drm/mediatek/mtk_drm_plane.c +4 -4
@@ -111,10 +111,10 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); } static void mtk_plane_atomic_update(struct drm_plane *plane,
drivers/gpu/drm/meson/meson_plane.c +4 -4
@@ -61,10 +61,10 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); }/* Takes a fixed 16.16 number and converts it to integer. */
drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +3 -2
@@ -348,8 +348,9 @@ 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 ); - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;
drivers/gpu/drm/nouveau/nv50_display.c +10 -10
@@ -1143,11 +1143,11 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, {int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); asyh->curs.visible = asyw->state.visible;if (ret || !asyh->curs.visible)return ret;
@@ -1433,11 +1433,11 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,if (!fb->format->depth)return -EINVAL ; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +3 -3
@@ -659,9 +659,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, - true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;
drivers/gpu/drm/tegra/dc.c +2 -2
@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;
drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4 -4
@@ -454,10 +454,10 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;
drivers/gpu/drm/zte/zx_plane.c +8 -7
@@ -80,9 +80,9 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, - min_scale, max_scale, - true, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, min_scale, max_scale, + true, true); }static int zx_vl_get_fmt (uint32_t format)
@@ -315,10 +315,11 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); }static int zx_gl_get_fmt (uint32_t format)
include/drm/drm_atomic_helper.h +7 -0
@@ -38,6 +38,13 @@ struct drm_private_state;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, +bool can_update_disabled);int drm_atomic_helper_check_planes (struct drm_device *dev,struct drm_atomic_state *state); int drm_atomic_helper_check(struct drm_device *dev,
include/drm/drm_plane_helper.h +0 -6
@@ -38,12 +38,6 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_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, -bool can_update_disabled); int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,
Signature · 6 lines
2.13.6 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [PATCH v2 5/5] drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
Quoted 11 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
drm_plane_helper_check_update()isn't a transitional helper, so let's rename it todrm_atomic_helper_check_plane_state()and move it intodrm_atomic_helper.c.v2: Fix the WARNs about
plane_state->crtcmatchingcrtc_state->crtcCc Daniel Vetter <[email protected]>Suggested-by Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
I guess I should finally unlazy and split up drm_atomic_helper.c into the different parts, it's getting a bit huge. But after your stuff has landed.
Before pushing pls make sure vmwgfx has been tested, and ofc that our CI approves too.
Cheers, Daniel
Quoted 572 lines
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 8 +-- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 94 +++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 102 ++-------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 +-- drivers/gpu/drm/i915/intel_display.c | 22 +++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +-- drivers/gpu/drm/meson/meson_plane.c | 8 +-- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 20 +++--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +-- drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 6 -- 17 files changed, 169 insertions(+), 165 deletions(-)drivers/gpu/drm/arm/hdlcd_crtc.c +4
-4@@ -252,10 +252,10 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); } static void hdlcd_plane_atomic_update(struct drm_plane *plane,drivers/gpu/drm/arm/malidp_planes.c +2
-2@@ -150,8 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;drivers/gpu/drm/drm_atomic_helper.c +94
-0@@ -696,6 +696,100 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,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 +* doesn't cover the entire crtc? This will generally +* only be false for primary planes. +* @can_update_disabled: can the plane be updated while the crtc +* is disabled? +* +* Checks that a desired plane update is valid, and updates various +* bits of derived state (clipped coordinates etc.). Drivers that provide +* their own plane handling rather than helper-provided implementations may +* still wish to call this function to avoid duplication of error checking +* code. +* +* RETURNS: +* Zero if update appears valid, error code on failure +*/ +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, +bool can_update_disabled) +{ +struct drm_framebuffer *fb = plane_state->fb; +struct drm_rect *src = &plane_state->src; +struct drm_rect *dst = &plane_state->dst; +unsigned int rotation = plane_state->rotation; +int hscale, vscale; + +WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc); + + *src =drm_plane_state_src (plane_state); + *dst =drm_plane_state_dest (plane_state); + +if (!fb) { + plane_state->visible = false; +return 0 ; + } + +/* crtc should only be NULL when disabling (i.e., !fb) */ +if (WARN_ON (!plane_state->crtc)) { + plane_state->visible = false; +return 0 ; + } + +if (!crtc_state->enable && !can_update_disabled) { +DRM_DEBUG_KMS ("Cannot update plane of a disabled CRTC.\n" ); +return -EINVAL ; + } + +drm_rect_rotate (src, fb->width <<16 , fb->height <<16 , rotation); + +/* Check scaling */ + hscale =drm_rect_calc_hscale (src, dst, min_scale, max_scale); + vscale =drm_rect_calc_vscale (src, dst, min_scale, max_scale); +if (hscale <0 || vscale <0 ) { +DRM_DEBUG_KMS ("Invalid scaling of plane\n" ); +drm_rect_debug_print ("src: " , &plane_state->src, true); +drm_rect_debug_print ("dst: " , &plane_state->dst, false); +return -ERANGE ; + } + + plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); + +drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation); + +if (!plane_state->visible) +/* +* Plane isn't visible; some drivers can handle this +* so we just return success here. Drivers that can't +* (including those that use the primary plane helper's +* update function) will return an error from their +* update_plane handler. +*/ +return 0 ; + +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); +return -EINVAL ; + } + +return 0 ; +} +EXPORT_SYMBOL (drm_atomic_helper_check_plane_state); + +/** * drm_atomic_helper_check_planes - validate state object for planes changes * @dev: DRM device * @state: the driver state object drivers/gpu/drm/drm_plane_helper.c +4
-98@@ -100,100 +100,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, }/** -* drm_plane_helper_check_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 -* doesn't cover the entire crtc? This will generally -* only be false for primary planes. -* @can_update_disabled: can the plane be updated while the crtc -* is disabled? -* -* Checks that a desired plane update is valid, and updates various -* bits of derived state (clipped coordinates etc.). Drivers that provide -* their own plane handling rather than helper-provided implementations may -* still wish to call this function to avoid duplication of error checking -* code. -* -* RETURNS: -* Zero if update appears valid, error code on failure -*/ -int drm_plane_helper_check_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, -bool can_update_disabled) -{ -struct drm_framebuffer *fb = plane_state->fb; -struct drm_rect *src = &plane_state->src; -struct drm_rect *dst = &plane_state->dst; -unsigned int rotation = plane_state->rotation; -int hscale, vscale; - -WARN_ON (plane_state->crtc && plane_state->crtc != crtc_state->crtc); - - *src =drm_plane_state_src (plane_state); - *dst =drm_plane_state_dest (plane_state); - -if (!fb) { - plane_state->visible = false; -return 0 ; - } - -/* crtc should only be NULL when disabling (i.e., !fb) */ -if (WARN_ON (!plane_state->crtc)) { - plane_state->visible = false; -return 0 ; - } - -if (!crtc_state->enable && !can_update_disabled) { -DRM_DEBUG_KMS ("Cannot update plane of a disabled CRTC.\n" ); -return -EINVAL ; - } - -drm_rect_rotate (src, fb->width <<16 , fb->height <<16 , rotation); - -/* Check scaling */ - hscale =drm_rect_calc_hscale (src, dst, min_scale, max_scale); - vscale =drm_rect_calc_vscale (src, dst, min_scale, max_scale); -if (hscale <0 || vscale <0 ) { -DRM_DEBUG_KMS ("Invalid scaling of plane\n" ); -drm_rect_debug_print ("src: " , &plane_state->src, true); -drm_rect_debug_print ("dst: " , &plane_state->dst, false); -return -ERANGE ; - } - - plane_state->visible =drm_rect_clip_scaled (src, dst, clip, hscale, vscale); - -drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation); - -if (!plane_state->visible) -/* -* Plane isn't visible; some drivers can handle this -* so we just return success here. Drivers that can't -* (including those that use the primary plane helper's -* update function) will return an error from their -* update_plane handler. -*/ -return 0 ; - -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); -return -EINVAL ; - } - -return 0 ; -} -EXPORT_SYMBOL (drm_plane_helper_check_state); - -/** * drm_plane_helper_check_update() - Check plane update for validity * @plane: plane object to update * @crtc: owning CRTC of owning plane @@ -254,10 +160,10 @@ int drm_plane_helper_check_update(struct drm_plane *plane, };int ret; - ret =drm_plane_helper_check_state (&plane_state, &crtc_state, clip, - min_scale, max_scale, - can_position, - can_update_disabled); + ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, + clip, min_scale, max_scale, + can_position, + can_update_disabled);if (ret)return ret;drivers/gpu/drm/drm_simple_kms_helper.c +5
-4@@ -103,10 +103,11 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;drivers/gpu/drm/i915/intel_display.c +11
-11@@ -9316,12 +9316,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state,u32 offset;int ret; - ret =drm_plane_helper_check_state (&plane_state->base, - &crtc_state->base, - &plane_state->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&plane_state->base, + &crtc_state->base, + &plane_state->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true);if (ret)return ret;@@ -12808,11 +12808,11 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } - ret =drm_plane_helper_check_state (&state->base, - &crtc_state->base, - &state->clip, - min_scale, max_scale, - can_position, true); + ret =drm_atomic_helper_check_plane_state (&state->base, + &crtc_state->base, + &state->clip, + min_scale, max_scale, + can_position, true);if (ret)return ret;drivers/gpu/drm/imx/ipuv3-plane.c +4
-4@@ -342,10 +342,10 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - can_position, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + can_position, true);if (ret)return ret;drivers/gpu/drm/mediatek/mtk_drm_plane.c +4
-4@@ -111,10 +111,10 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); } static void mtk_plane_atomic_update(struct drm_plane *plane,drivers/gpu/drm/meson/meson_plane.c +4
-4@@ -61,10 +61,10 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); }/* Takes a fixed 16.16 number and converts it to integer. */ drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +3
-2@@ -348,8 +348,9 @@ 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 ); - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;drivers/gpu/drm/nouveau/nv50_display.c +10
-10@@ -1143,11 +1143,11 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, {int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); asyh->curs.visible = asyw->state.visible;if (ret || !asyh->curs.visible)return ret;@@ -1433,11 +1433,11 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw,if (!fb->format->depth)return -EINVAL ; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;drivers/gpu/drm/rockchip/rockchip_drm_vop.c +3
-3@@ -659,9 +659,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, - true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;drivers/gpu/drm/tegra/dc.c +2
-2@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4
-4@@ -454,10 +454,10 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;drivers/gpu/drm/zte/zx_plane.c +8
-7@@ -80,9 +80,9 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, - min_scale, max_scale, - true, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, min_scale, max_scale, + true, true); }static int zx_vl_get_fmt (uint32_t format)@@ -315,10 +315,11 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); }static int zx_gl_get_fmt (uint32_t format)include/drm/drm_atomic_helper.h +7
-0@@ -38,6 +38,13 @@ struct drm_private_state;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, +bool can_update_disabled);int drm_atomic_helper_check_planes (struct drm_device *dev,struct drm_atomic_state *state); int drm_atomic_helper_check(struct drm_device *dev,include/drm/drm_plane_helper.h +0
-6@@ -38,12 +38,6 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_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, -bool can_update_disabled); int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,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
Re: [PATCH 5/5] drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c
In reply to Ville SyrjalaHi Ville,
Thank you for the patch.
Quoted 9 lines · On Wednesday, 1 November 2017 20:29:20 EET Ville Syrjala wrote:
From: Ville Syrjälä <[email protected]>
drm_plane_helper_check_update()isn't a transitional helper, so let's rename it todrm_atomic_helper_check_plane_state()and move it intodrm_atomic_helper.c.Cc Daniel Vetter <[email protected]>Suggested-by Daniel Vetter <[email protected]>Signed-off-by Ville Syrjälä <[email protected]>
I would move this patch before 4/5 to make it easier to revert 4/5 (for the reason explaining as a reply to that patch).
Quoted 583 lines
--- drivers/gpu/drm/arm/hdlcd_crtc.c | 8 +-- drivers/gpu/drm/arm/malidp_planes.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 95 +++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 103 +----------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 +-- drivers/gpu/drm/i915/intel_display.c | 22 +++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +-- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +-- drivers/gpu/drm/meson/meson_plane.c | 8 +-- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 20 +++--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 8 +-- drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 6 -- 17 files changed, 170 insertions(+), 166 deletions(-)(quoted diff) +0
-0
b/drivers/gpu/drm/arm/hdlcd_crtc.cindex14721723fa8a..63511a3bbf6c100644drivers/gpu/drm/arm/hdlcd_crtc.c +4
-4@@ -252,10 +252,10 @@ static int hdlcd_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); } static void hdlcd_plane_atomic_update(struct drm_plane *plane,(quoted diff) +0
-0
b/drivers/gpu/drm/arm/malidp_planes.cindex492d99dd55d4..72a07950167e100644drivers/gpu/drm/arm/malidp_planes.c +2
-2@@ -150,8 +150,8 @@ static int malidp_se_check_scaling(struct malidp_plane *mp, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/drm_atomic_helper.cindex71d712f1b56a..7595ad8ad2f3100644drivers/gpu/drm/drm_atomic_helper.c +69
-0@@ -696,6 +696,101 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,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 +* doesn't cover the entire crtc? This will generally +* only be false for primary planes. +* @can_update_disabled: can the plane be updated while the crtc +* is disabled? +* +* Checks that a desired plane update is valid, and updates various +* bits of derived state (clipped coordinates etc.). Drivers that provide +* their own plane handling rather than helper-provided implementations may +* still wish to call this function to avoid duplication of error checking +* code. +* +* RETURNS: +* Zero if update appears valid, error code on failure +*/ +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, +bool can_update_disabled) +{ +struct drm_framebuffer *fb = plane_state->fb; +struct drm_rect *src = &plane_state->src; +struct drm_rect *dst = &plane_state->dst; +unsigned int rotation = plane_state->rotation; +int hscale, vscale; + +WARN_ON (!crtc_state != !plane_state->crtc); +WARN_ON (crtc_state && crtc_state->crtc != plane_state->crtc); + + *src =drm_plane_state_src (plane_state); + *dst =drm_plane_state_dest (plane_state); + +if (!fb) { + plane_state->visible = false; +return 0 ; + } + +/* crtc should only be NULL when disabling (i.e., !fb) */ +if (WARN_ON (!plane_state->crtc)) { + plane_state->visible = false; +return 0 ; + } + +if (!crtc_state->enable && !can_update_disabled) { +DRM_DEBUG_KMS ("Cannot update plane of a disabled CRTC.\n" ); +return -EINVAL ; + } + +drm_rect_rotate (src, fb->width <<16 , fb->height <<16 , rotation); + +/* Check scaling */ + hscale =drm_rect_calc_hscale (src, dst, min_scale, max_scale); + vscale =drm_rect_calc_vscale (src, dst, min_scale, max_scale); +if (hscale <0 || vscale <0 ) { +DRM_DEBUG_KMS ("Invalid scaling of plane\n" ); +drm_rect_debug_print ("src: " , &plane_state->src, true); +drm_rect_debug_print ("dst: " , &plane_state->dst, false); +return -ERANGE ; + } + + plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale,vscale); +
drivers/gpu/drm/drm_atomic_helper.c +24
-0+drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation); + +if (!plane_state->visible) +/* +* Plane isn't visible; some drivers can handle this +* so we just return success here. Drivers that can't +* (including those that use the primary plane helper's +* update function) will return an error from their +* update_plane handler. +*/ +return 0 ; + +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); +return -EINVAL ; + } + +return 0 ; +} +EXPORT_SYMBOL (drm_atomic_helper_check_plane_state); + +/** * drm_atomic_helper_check_planes - validate state object for planes changes * @dev: DRM device
* @state: the driver state object(quoted diff) +0
-0
b/drivers/gpu/drm/drm_plane_helper.cindexadb8d94484f2..f1be8cd4e387100644drivers/gpu/drm/drm_plane_helper.c +0
-70@@ -100,101 +100,6 @@ static int get_connectors_for_crtc(struct drm_crtc *crtc, }/** -* drm_plane_helper_check_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 -* doesn't cover the entire crtc? This will generally -* only be false for primary planes. -* @can_update_disabled: can the plane be updated while the crtc -* is disabled? -* -* Checks that a desired plane update is valid, and updates various -* bits of derived state (clipped coordinates etc.). Drivers that provide -* their own plane handling rather than helper-provided implementations may -* still wish to call this function to avoid duplication of error checking -* code. -* -* RETURNS: -* Zero if update appears valid, error code on failure -*/ -int drm_plane_helper_check_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, -bool can_update_disabled) -{ -struct drm_framebuffer *fb = plane_state->fb; -struct drm_rect *src = &plane_state->src; -struct drm_rect *dst = &plane_state->dst; -unsigned int rotation = plane_state->rotation; -int hscale, vscale; - -WARN_ON (!crtc_state != !plane_state->crtc); -WARN_ON (crtc_state && crtc_state->crtc != plane_state->crtc); - - *src =drm_plane_state_src (plane_state); - *dst =drm_plane_state_dest (plane_state); - -if (!fb) { - plane_state->visible = false; -return 0 ; - } - -/* crtc should only be NULL when disabling (i.e., !fb) */ -if (WARN_ON (!plane_state->crtc)) { - plane_state->visible = false; -return 0 ; - } - -if (!crtc_state->enable && !can_update_disabled) { -DRM_DEBUG_KMS ("Cannot update plane of a disabled CRTC.\n" ); -return -EINVAL ; - } - -drm_rect_rotate (src, fb->width <<16 , fb->height <<16 , rotation); - -/* Check scaling */ - hscale =drm_rect_calc_hscale (src, dst, min_scale, max_scale); - vscale =drm_rect_calc_vscale (src, dst, min_scale, max_scale); -if (hscale <0 || vscale <0 ) { -DRM_DEBUG_KMS ("Invalid scaling of plane\n" ); -drm_rect_debug_print ("src: " , &plane_state->src, true); -drm_rect_debug_print ("dst: " , &plane_state->dst, false); -return -ERANGE ; - } - - plane_state->visible = drm_rect_clip_scaled(src, dst, clip, hscale,vscale); -
drivers/gpu/drm/drm_plane_helper.c +4
-28-drm_rect_rotate_inv (src, fb->width <<16 , fb->height <<16 , rotation); - -if (!plane_state->visible) -/* -* Plane isn't visible; some drivers can handle this -* so we just return success here. Drivers that can't -* (including those that use the primary plane helper's -* update function) will return an error from their -* update_plane handler. -*/ -return 0 ; - -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); -return -EINVAL ; - } - -return 0 ; -} -EXPORT_SYMBOL (drm_plane_helper_check_state); - -/** * drm_plane_helper_check_update() - Check plane update for validity * @plane: plane object to update * @crtc: owning CRTC of owning plane @@ -255,10 +160,10 @@ int drm_plane_helper_check_update(struct drm_plane *plane, };int ret; - ret =drm_plane_helper_check_state (&plane_state, &crtc_state, clip, - min_scale, max_scale, - can_position, - can_update_disabled); + ret =drm_atomic_helper_check_plane_state (&plane_state, &crtc_state, + clip, min_scale, max_scale, + can_position, + can_update_disabled);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/drm_simple_kms_helper.cindexd428c805025c..9f3b1c94802b100644drivers/gpu/drm/drm_simple_kms_helper.c +5
-4@@ -103,10 +103,11 @@ static int drm_simple_kms_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/i915/intel_display.cindex4a459726b36b..e0ff599d2090100644drivers/gpu/drm/i915/intel_display.c +11
-11@@ -9316,12 +9316,12 @@ static int intel_check_cursor(struct intel_crtc_state *crtc_state, u32 offset;int ret; - ret =drm_plane_helper_check_state (&plane_state->base, - &crtc_state->base, - &plane_state->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&plane_state->base, + &crtc_state->base, + &plane_state->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true);if (ret)return ret;@@ -12808,11 +12808,11 @@ intel_check_primary_plane(struct intel_plane *plane, can_position = true; } - ret =drm_plane_helper_check_state (&state->base, - &crtc_state->base, - &state->clip, - min_scale, max_scale, - can_position, true); + ret =drm_atomic_helper_check_plane_state (&state->base, + &crtc_state->base, + &state->clip, + min_scale, max_scale, + can_position, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/imx/ipuv3-plane.cindex51b23ac175e3..5a67daedcf4d100644drivers/gpu/drm/imx/ipuv3-plane.c +4
-4@@ -342,10 +342,10 @@ static int ipu_plane_atomic_check(struct drm_plane *plane, clip.y1 =0 ; clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - can_position, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + can_position, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/mediatek/mtk_drm_plane.cindex7ebb33657704..5ef898b93d8d100644drivers/gpu/drm/mediatek/mtk_drm_plane.c +4
-4@@ -111,10 +111,10 @@ static int mtk_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); } static void mtk_plane_atomic_update(struct drm_plane *plane,(quoted diff) +0
-0
b/drivers/gpu/drm/meson/meson_plane.cindex2a00b720c371..d0a6ac8390f3100644drivers/gpu/drm/meson/meson_plane.c +4
-4@@ -61,10 +61,10 @@ static int meson_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->mode.hdisplay; clip.y2 = crtc_state->mode.vdisplay; -return drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); +return drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); }/* Takes a fixed 16.16 number and converts it to integer. */ (quoted diff) +0
-0
b/drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.cindex1c194a9453d9..df3360acacca100644drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c +3
-2@@ -348,8 +348,9 @@ static int mdp5_plane_atomic_check_with_state(structdrm_crtc_state *crtc_state, min_scale =FRAC_16_16 (1 ,8 ); max_scale =FRAC_16_16 (8 ,1 ); - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/nouveau/nv50_display.cindex7f11a88d0593..8ab0fac3544d100644drivers/gpu/drm/nouveau/nv50_display.c +10
-10@@ -1143,11 +1143,11 @@ nv50_curs_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, { int ret; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - true, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + true, true); asyh->curs.visible = asyw->state.visible;if (ret || !asyh->curs.visible)return ret;@@ -1433,11 +1433,11 @@ nv50_base_acquire(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw, if (!fb->format->depth) return -EINVAL; - ret =drm_plane_helper_check_state (&asyw->state, &asyh->state, - &asyw->clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (&asyw->state, &asyh->state, + &asyw->clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (ret)return ret;(quoted diff) +0
-0
b/drivers/gpu/drm/rockchip/rockchip_drm_vop.cindex36d0f101e30d..ba7505292b78100644drivers/gpu/drm/rockchip/rockchip_drm_vop.c +3
-3@@ -659,9 +659,9 @@ static int vop_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; - ret =drm_plane_helper_check_state (state, crtc_state, &clip, - min_scale, max_scale, - true, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, + min_scale, max_scale, + true, true);if (ret)return ret;drivers/gpu/drm/tegra/dc.c +2
-2@@ -491,8 +491,8 @@ static int tegra_plane_state_add(struct tegra_plane *plane, clip.y2 = crtc_state->mode.vdisplay;/* Check plane state for visibility and calculate clipping bounds */ - err =drm_plane_helper_check_state (state, crtc_state, &clip, -0 ,INT_MAX , true, true); + err =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +0 ,INT_MAX , true, true);if (err <0 )return err;(quoted diff) +0
-0
b/drivers/gpu/drm/vmwgfx/vmwgfx_kms.cindexd95e7b1c3b11..a2a93d7e2a04100644drivers/gpu/drm/vmwgfx/vmwgfx_kms.c +4
-4@@ -454,10 +454,10 @@ int vmw_du_primary_plane_atomic_check(struct drm_plane *plane, clip.y2 = crtc_state->adjusted_mode.vdisplay; } - ret =drm_plane_helper_check_state (state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); + ret =drm_atomic_helper_check_plane_state (state, crtc_state, &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true);if (!ret && new_fb) {struct drm_crtc *crtc = state->crtc;drivers/gpu/drm/zte/zx_plane.c +8
-7@@ -80,9 +80,9 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, - min_scale, max_scale, - true, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, min_scale, max_scale, + true, true); }static int zx_vl_get_fmt (uint32_t format)@@ -315,10 +315,11 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane, clip.x2 = crtc_state->adjusted_mode.hdisplay; clip.y2 = crtc_state->adjusted_mode.vdisplay; -return drm_plane_helper_check_state (plane_state, crtc_state, &clip, -DRM_PLANE_HELPER_NO_SCALING , -DRM_PLANE_HELPER_NO_SCALING , - false, true); +return drm_atomic_helper_check_plane_state (plane_state, crtc_state, + &clip, +DRM_PLANE_HELPER_NO_SCALING , +DRM_PLANE_HELPER_NO_SCALING , + false, true); }static int zx_gl_get_fmt (uint32_t format)(quoted diff) +0
-0
b/include/drm/drm_atomic_helper.hindexd2b56cc657e9..4842ee9485ce100644include/drm/drm_atomic_helper.h +6
-0@@ -38,6 +38,13 @@ struct drm_private_state;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, +bool can_update_disabled);int drm_atomic_helper_check_planes (struct drm_device *dev,struct drm_atomic_state *state); int drm_atomic_helper_check(struct drm_device *dev,include/drm/drm_plane_helper.h +0
-6@@ -38,12 +38,6 @@*/ #define DRM_PLANE_HELPER_NO_SCALING (1<<16) -int drm_plane_helper_check_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, -bool can_update_disabled); int drm_plane_helper_check_update(struct drm_plane *plane, struct drm_crtc *crtc, struct drm_framebuffer *fb,
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Patchwork
CI✗ Fi.CI.BAT: failure for drm: drm_plane_helper_check_state() related stuff
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: drm_plane_helper_check_state() related stuff
URL : https://patchwork.freedesktop.org/series/33002/
State : failure
== Summary ==
Series 33002v1 drm: drm_plane_helper_check_state() related stuff
https://patchwork.freedesktop.org/api/1.0/series/33002/revisions/1/mbox/
Test chamelium:
Subgroup dp-edid-read:
pass -> DMESG-WARN (fi-kbl-7500u) fdo#102672
Subgroup dp-crc-fast:
pass -> DMESG-WARN (fi-kbl-7500u) fdo#102514
Subgroup hdmi-edid-read:
pass -> DMESG-WARN (fi-skl-6700k)
Subgroup hdmi-crc-fast:
pass -> DMESG-WARN (fi-skl-6700k)
Subgroup common-hpd-after-suspend:
pass -> DMESG-WARN (fi-skl-6700k)
Test debugfs_test:
Subgroup read_all_entries:
pass -> DMESG-WARN (fi-gdg-551)
pass -> DMESG-WARN (fi-blb-e6850)
pass -> DMESG-WARN (fi-pnv-d510)
pass -> DMESG-WARN (fi-bwr-2160)
pass -> DMESG-WARN (fi-elk-e7500)
pass -> DMESG-WARN (fi-ilk-650)
pass -> DMESG-WARN (fi-snb-2520m)
pass -> DMESG-WARN (fi-snb-2600)
pass -> DMESG-WARN (fi-ivb-3520m)
pass -> DMESG-WARN (fi-ivb-3770)
pass -> DMESG-WARN (fi-byt-j1900)
pass -> DMESG-WARN (fi-byt-n2820)
pass -> DMESG-WARN (fi-hsw-4770)
pass -> DMESG-WARN (fi-hsw-4770r)
pass -> DMESG-WARN (fi-bdw-5557u)
pass -> DMESG-WARN (fi-bdw-gvtdvm)
pass -> DMESG-WARN (fi-bsw-n3050)
pass -> DMESG-WARN (fi-skl-6260u)
pass -> DMESG-WARN (fi-skl-6600u)
pass -> DMESG-WARN (fi-skl-6700hq)
pass -> DMESG-WARN (fi-skl-6700k)
pass -> DMESG-WARN (fi-skl-6770hq)
pass -> DMESG-WARN (fi-skl-gvtdvm)
pass -> DMESG-WARN (fi-bxt-dsi)
pass -> DMESG-WARN (fi-bxt-j4205)
pass -> DMESG-WARN (fi-kbl-7500u) fdo#103285
pass -> DMESG-WARN (fi-kbl-7560u)
pass -> DMESG-WARN (fi-kbl-7567u)
pass -> DMESG-WARN (fi-kbl-r)
pass -> DMESG-WARN (fi-glk-1)
pass -> DMESG-WARN (fi-glk-dsi)
pass -> DMESG-WARN (fi-cfl-s) fdo#103186
pass -> DMESG-WARN (fi-cnl-y)
Test drv_hangman:
Subgroup error-state-basic:
pass -> DMESG-WARN (fi-gdg-551)
pass -> DMESG-WARN (fi-blb-e6850)
pass -> DMESG-WARN (fi-pnv-d510)
pass -> DMESG-WARN (fi-bwr-2160)
Test gem_busy:
Subgroup basic-hang-default:
pass -> DMESG-WARN (fi-blb-e6850)
pass -> DMESG-WARN (fi-pnv-d510)
Test gem_exec_fence:
Subgroup await-hang-default:
pass -> DMESG-WARN (fi-blb-e6850)
pass -> DMESG-WARN (fi-pnv-d510)
Test gem_exec_suspend:
Subgroup basic-s3:
pass -> DMESG-WARN (fi-blb-e6850)
pass -> DMESG-WARN (fi-pnv-d510)
pass -> DMESG-WARN (fi-elk-e7500)
pass -> DMESG-WARN (fi-ilk-650)
pass -> DMESG-WARN (fi-snb-2520m)
pass -> DMESG-WARN (fi-snb-2600) fdo#102365
pass -> DMESG-WARN (fi-ivb-3520m)
pass -> DMESG-WARN (fi-ivb-3770)
pass -> DMESG-WARN (fi-byt-j1900)
pass -> DMESG-WARN (fi-byt-n2820)
pass -> DMESG-WARN (fi-hsw-4770)
pass -> DMESG-WARN (fi-hsw-4770r)
pass -> DMESG-WARN (fi-bdw-5557u)
pass -> DMESG-WARN (fi-bdw-gvtdvm)
pass -> DMESG-WARN (fi-bsw-n3050)
pass -> DMESG-WARN (fi-skl-6260u)
pass -> DMESG-WARN (fi-skl-6600u)
pass -> DMESG-WARN (fi-skl-6700hq)
pass -> DMESG-WARN (fi-skl-6700k)
pass -> DMESG-WARN (fi-skl-6770hq)
pass -> DMESG-WARN (fi-skl-gvtdvm)
pass -> DMESG-WARN (fi-bxt-dsi)
pass -> DMESG-WARN (fi-bxt-j4205)
pass -> DMESG-WARN (fi-kbl-7500u)
pass -> DMESG-FAIL (fi-kbl-7560u) fdo#103039
pass -> DMESG-WARN (fi-kbl-7567u) fdo#102846 +11
pass -> DMESG-WARN (fi-glk-1)
pass -> DMESG-WARN (fi-glk-dsi)
pass -> DMESG-WARN (fi-cnl-y)
Subgroup basic-s4-devices:
pass -> DMESG-WARN (fi-blb-e6850)
pass -> DMESG-WARN (fi-pnv-d510)
pass -> DMESG-WARN (fi-elk-e7500)
pass -> DMESG-WARN (fi-ilk-650)
pass -> DMESG-WARN (fi-snb-2520m)WARNING: Long output truncated
7da46c0a019ebaec3f67a8a6ccc60a56c2d521b1 drm-tip: 2017y-11m-01d-17h-32m-50s UTC integration manifest 6d81deae6f47 drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c a9ff8519c323 drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state() 67d75a7c518d drm/vmwgfx: Try to fix plane clippingb824112d55f1 drm/vmwgfx: Use drm_plane_helper_check_state()9e9194d33463 drm/vmwgfx: Remove bogus crtc coords vs fb size check
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6302/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: ✗ Fi.CI.BAT: failure for drm: drm_plane_helper_check_state() related stuff
Quoted 12 lines · Patchwork
== Series Details ==
Series: drm:
drm_plane_helper_check_state()related stuff
URL : https://patchwork.freedesktop.org/series/33002/
State : failure== Summary ==
Series 33002v1 drm:
drm_plane_helper_check_state()related stuff
https://patchwork.freedesktop.org/api/1.0/series/33002/revisions/1/mbox/Test chamelium:
Quoted 10 lines
Subgroup dp-edid-read:
pass -> DMESG-WARN (fi-kbl-7500u) fdo#102672
Subgroup dp-crc-fast:
pass -> DMESG-WARN (fi-kbl-7500u) fdo#102514
Subgroup hdmi-edid-read:
pass -> DMESG-WARN (fi-skl-6700k)
Subgroup hdmi-crc-fast:
pass -> DMESG-WARN (fi-skl-6700k)
Subgroup common-hpd-after-suspend:
pass -> DMESG-WARN (fi-skl-6700k)Thinko in my WARNs.
I guess it needs to be something like:
- WARN_ON(!crtc_state != !plane_state->crtc); - WARN_ON(crtc_state && crtc_state->crtc != plane_state->crtc); + WARN_ON(plane_state->crtc && plane_state->crtc != crtc_state->crtc);
since we grab the crtc from the old plane state if the new plane state doesn't have one. And thus the crtc state we pass around may refer to the old crtc, not the new one (well, there won't be a new one in those cases).
Although I'm not sure how sensible it is to use the crtc state of the old crtc for state computation/checks in general. Feels a bit iffy at least.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.BAT: success for drm: drm_plane_helper_check_state() related stuff (rev3)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: drm_plane_helper_check_state() related stuff (rev3)
URL : https://patchwork.freedesktop.org/series/33002/
State : success
== Summary ==
Series 33002v3 drm: drm_plane_helper_check_state() related stuff
https://patchwork.freedesktop.org/api/1.0/series/33002/revisions/3/mbox/
Test chamelium:
Subgroup dp-crc-fast:
pass -> FAIL (fi-kbl-7500u) fdo#102514
Subgroup common-hpd-after-suspend:
dmesg-warn -> PASS (fi-kbl-7500u) fdo#102505
Test kms_frontbuffer_tracking:
Subgroup basic:
fail -> PASS (fi-glk-dsi) fdo#103167fdo#102514 https://bugs.freedesktop.org/show_bug.cgi?id=102514
fdo#102505 https://bugs.freedesktop.org/show_bug.cgi?id=102505
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fi-bdw-5557u total:289 pass:268 dwarn:0 dfail:0 fail:0 skip:21 time:442s fi-bdw-gvtdvm total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:459s fi-blb-e6850 total:289 pass:223 dwarn:1 dfail:0 fail:0 skip:65 time:378s fi-bsw-n3050 total:289 pass:243 dwarn:0 dfail:0 fail:0 skip:46 time:539s fi-bwr-2160 total:289 pass:183 dwarn:0 dfail:0 fail:0 skip:106 time:277s fi-bxt-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:512s fi-bxt-j4205 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:500s fi-byt-j1900 total:289 pass:253 dwarn:1 dfail:0 fail:0 skip:35 time:510s fi-byt-n2820 total:289 pass:249 dwarn:1 dfail:0 fail:0 skip:39 time:487s fi-cfl-s total:289 pass:253 dwarn:4 dfail:0 fail:0 skip:32 time:546s fi-cnl-y total:217 pass:196 dwarn:0 dfail:0 fail:0 skip:20 fi-elk-e7500 total:289 pass:229 dwarn:0 dfail:0 fail:0 skip:60 time:421s fi-gdg-551 total:289 pass:178 dwarn:1 dfail:0 fail:1 skip:109 time:269s fi-glk-1 total:289 pass:261 dwarn:0 dfail:0 fail:0 skip:28 time:586s fi-glk-dsi total:289 pass:259 dwarn:0 dfail:0 fail:0 skip:30 time:489s fi-hsw-4770 total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:434s fi-hsw-4770r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:428s fi-ilk-650 total:289 pass:228 dwarn:0 dfail:0 fail:0 skip:61 time:424s fi-ivb-3520m total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:498s fi-ivb-3770 total:289 pass:260 dwarn:0 dfail:0 fail:0 skip:29 time:465s fi-kbl-7500u total:289 pass:264 dwarn:0 dfail:0 fail:1 skip:24 time:475s fi-kbl-7560u total:289 pass:270 dwarn:0 dfail:0 fail:0 skip:19 time:575s fi-kbl-7567u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:478s fi-kbl-r total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:580s fi-pnv-d510 total:289 pass:222 dwarn:1 dfail:0 fail:0 skip:66 time:574s fi-skl-6260u total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:457s fi-skl-6600u total:289 pass:262 dwarn:0 dfail:0 fail:0 skip:27 time:593s fi-skl-6700hq total:289 pass:263 dwarn:0 dfail:0 fail:0 skip:26 time:652s fi-skl-6700k total:289 pass:265 dwarn:0 dfail:0 fail:0 skip:24 time:517s fi-skl-6770hq total:289 pass:269 dwarn:0 dfail:0 fail:0 skip:20 time:507s fi-skl-gvtdvm total:289 pass:266 dwarn:0 dfail:0 fail:0 skip:23 time:459s fi-snb-2520m total:289 pass:250 dwarn:0 dfail:0 fail:0 skip:39 time:571s fi-snb-2600 total:289 pass:249 dwarn:0 dfail:0 fail:0 skip:40 time:426s
7da46c0a019ebaec3f67a8a6ccc60a56c2d521b1 drm-tip: 2017y-11m-01d-17h-32m-50s UTC integration manifest 5fd2ee28cd29 drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c f5a1386e738b drm: Check crtc_state->enable rather than crtc->enabled in drm_plane_helper_check_state() 9b967ad53783 drm/vmwgfx: Try to fix plane clipping6fb4866d13f0 drm/vmwgfx: Use drm_plane_helper_check_state()488c96ed9533 drm/vmwgfx: Remove bogus crtc coords vs fb size check
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6304/
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✓ Fi.CI.IGT: success for drm: drm_plane_helper_check_state() related stuff (rev3)
In reply to Ville Syrjala== Series Details ==
== Series Details ==
Series: drm: drm_plane_helper_check_state() related stuff (rev3)
URL : https://patchwork.freedesktop.org/series/33002/
State : success
== Summary ==
Test drv_module_reload:
Subgroup basic-reload:
pass -> DMESG-WARN (shard-hsw) fdo#102707
Test kms_flip:
Subgroup modeset-vs-vblank-race-interruptible:
fail -> PASS (shard-hsw) fdo#103060
Test perf:
Subgroup oa-exponents:
fail -> PASS (shard-hsw) fdo#102254fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
shard-hsw total:2539 pass:1431 dwarn:2 dfail:0 fail:9 skip:1097 time:9286s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_6304/shards.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Sorry this took so long.
The vmwgfx part: Reviewed-by: Sinclair Yeh <[email protected]>
I've done some testing and the vmwgfx part looks good. Has Daniel already taken these or should I put them in my next request?
Sinclair
Quoted 37 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
While trawling the tree I spotted some issues with the way vmwgfx uses
drm_plane_helper_check_state(). Here's my attempt at fixing it. Do note that I haven't actually tested the resulting code at all, but it does build at least.And while touching that general area I took up Daniel's suggestion from long ago that
drm_plane_helper_check_state()should be renamed and relocated to better reflect its status.Here's a branch with the entire series:
git://github.com/vsyrjala/linux.gitatomic_helper_plane_stuffCc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Daniel Vetter <[email protected]>Ville Syrjälä (5):
drm/vmwgfx: Remove bogus crtc coords vs fb size check drm/vmwgfx: Usedrm_plane_helper_check_state()drm/vmwgfx: Try to fix plane clipping
drm: Checkcrtc_state->enablerather thancrtc->enabledin
drm_plane_helper_check_state()
drm: Movedrm_plane_helper_check_state()intodrm_atomic_helper.cdrivers/gpu/drm/arm/hdlcd_crtc.c | 8 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_atomic_helper.c | 95 ++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 111 +++------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 ++- drivers/gpu/drm/i915/intel_display.c | 20 ++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +-
Quoted 12 lines
drivers/gpu/drm/nouveau/nv50_display.c | 18 +++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 40 ++++------ drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 5 -- 17 files changed, 187 insertions(+), 183 deletions(-)Signature · 1 line
2.13.6
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 1 line · Sinclair Yeh
Sorry this took so long.
No worries.
Quoted 5 lines
The vmwgfx part: Reviewed-by: Sinclair Yeh <[email protected]>
I've done some testing and the vmwgfx part looks good. Has Daniel already taken these or should I put them in my next request?
You can take them, or I can push them to drm-misc-next. Whatever works best for you.
And I'll want to revisit this topic soonish and move the clip handling into the helper as discussed with Daniel. But that can wait a bit until we get this round merged somewhere.
Quoted 53 lines
Sinclair
Quoted 49 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
While trawling the tree I spotted some issues with the way vmwgfx uses
drm_plane_helper_check_state(). Here's my attempt at fixing it. Do note that I haven't actually tested the resulting code at all, but it does build at least.And while touching that general area I took up Daniel's suggestion from long ago that
drm_plane_helper_check_state()should be renamed and relocated to better reflect its status.Here's a branch with the entire series:
git://github.com/vsyrjala/linux.gitatomic_helper_plane_stuffCc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Daniel Vetter <[email protected]>Ville Syrjälä (5):
drm/vmwgfx: Remove bogus crtc coords vs fb size check drm/vmwgfx: Usedrm_plane_helper_check_state()drm/vmwgfx: Try to fix plane clipping
drm: Checkcrtc_state->enablerather thancrtc->enabledin
drm_plane_helper_check_state()
drm: Movedrm_plane_helper_check_state()intodrm_atomic_helper.cdrivers/gpu/drm/arm/hdlcd_crtc.c | 8 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_atomic_helper.c | 95 ++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 111 +++------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 ++- drivers/gpu/drm/i915/intel_display.c | 20 ++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 18 +++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 40 ++++------ drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 5 -- 17 files changed, 187 insertions(+), 183 deletions(-)Signature · 1 line
2.13.6
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Quoted 11 lines · Ville Syrjälä
Quoted 1 line · Sinclair Yeh
Sorry this took so long.
No worries.
Quoted 5 lines
The vmwgfx part: Reviewed-by: Sinclair Yeh <[email protected]>
I've done some testing and the vmwgfx part looks good. Has Daniel already taken these or should I put them in my next request?
Quoted 6 lines
You can take them, or I can push them to drm-misc-next. Whatever works best for you.
And I'll want to revisit this topic soonish and move the clip handling into the helper as discussed with Daniel. But that can wait a bit until we get this round merged somewhere.
Because we're still in the merge window I think it's probably best if we push the entire series in through drm-misc. Tree-coordination in the merge window is always a bit a pain.
-Daniel
Quoted 58 lines
Quoted 54 lines
Sinclair
Quoted 49 lines · Ville Syrjala
From: Ville Syrjälä <[email protected]>
While trawling the tree I spotted some issues with the way vmwgfx uses
drm_plane_helper_check_state(). Here's my attempt at fixing it. Do note that I haven't actually tested the resulting code at all, but it does build at least.And while touching that general area I took up Daniel's suggestion from long ago that
drm_plane_helper_check_state()should be renamed and relocated to better reflect its status.Here's a branch with the entire series:
git://github.com/vsyrjala/linux.gitatomic_helper_plane_stuffCc VMware Graphics <[email protected]>Cc Sinclair Yeh <[email protected]>Cc Thomas Hellstrom <[email protected]>Cc Daniel Vetter <[email protected]>Ville Syrjälä (5):
drm/vmwgfx: Remove bogus crtc coords vs fb size check drm/vmwgfx: Usedrm_plane_helper_check_state()drm/vmwgfx: Try to fix plane clipping
drm: Checkcrtc_state->enablerather thancrtc->enabledin
drm_plane_helper_check_state()
drm: Movedrm_plane_helper_check_state()intodrm_atomic_helper.cdrivers/gpu/drm/arm/hdlcd_crtc.c | 8 +- drivers/gpu/drm/arm/malidp_planes.c | 3 +- drivers/gpu/drm/drm_atomic_helper.c | 95 ++++++++++++++++++++++++ drivers/gpu/drm/drm_plane_helper.c | 111 +++------------------------- drivers/gpu/drm/drm_simple_kms_helper.c | 9 ++- drivers/gpu/drm/i915/intel_display.c | 20 ++--- drivers/gpu/drm/imx/ipuv3-plane.c | 8 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 8 +- drivers/gpu/drm/meson/meson_plane.c | 8 +- drivers/gpu/drm/msm/mdp/mdp5/mdp5_plane.c | 5 +- drivers/gpu/drm/nouveau/nv50_display.c | 18 +++-- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +- drivers/gpu/drm/tegra/dc.c | 4 +- drivers/gpu/drm/vmwgfx/vmwgfx_kms.c | 40 ++++------ drivers/gpu/drm/zte/zx_plane.c | 15 ++-- include/drm/drm_atomic_helper.h | 7 ++ include/drm/drm_plane_helper.h | 5 -- 17 files changed, 187 insertions(+), 183 deletions(-)Signature · 1 line
2.13.6Signature · 2 lines
Ville Syrjälä Intel OTC
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
Quoted 15 lines · Daniel Vetter
Quoted 14 lines · Ville Syrjälä
Quoted 1 line · Sinclair Yeh
Sorry this took so long.
No worries.
Quoted 5 lines
The vmwgfx part: Reviewed-by: Sinclair Yeh <[email protected]>
I've done some testing and the vmwgfx part looks good. Has Daniel already taken these or should I put them in my next request?
You can take them, or I can push them to drm-misc-next. Whatever works best for you.
Quoted 8 lines
Quoted 3 lines
And I'll want to revisit this topic soonish and move the clip handling into the helper as discussed with Daniel. But that can wait a bit until we get this round merged somewhere.
Because we're still in the merge window I think it's probably best if we push the entire series in through drm-misc. Tree-coordination in the merge window is always a bit a pain.
-Daniel
Ok, so I'll leave this series to you then.
thanks,
Sinclair
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Quoted 20 lines · Sinclair Yeh
Quoted 19 lines · Daniel Vetter
Quoted 17 lines · Ville Syrjälä
Quoted 1 line · Sinclair Yeh
Sorry this took so long.
No worries.
Quoted 5 lines
The vmwgfx part: Reviewed-by: Sinclair Yeh <[email protected]>
I've done some testing and the vmwgfx part looks good. Has Daniel already taken these or should I put them in my next request?
You can take them, or I can push them to drm-misc-next. Whatever works best for you.
And I'll want to revisit this topic soonish and move the clip handling into the helper as discussed with Daniel. But that can wait a bit until we get this round merged somewhere.
Quoted 6 lines
Quoted 4 lines
Because we're still in the merge window I think it's probably best if we push the entire series in through drm-misc. Tree-coordination in the merge window is always a bit a pain.
-DanielOk, so I'll leave this series to you then.
All right. Series pushed to drm-misc-next. Thanks for the reviews.
Signature · 6 lines
Ville Syrjälä Intel OTC _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Hi Ville,
Quoted 20 lines · On Monday, 20 November 2017 21:36:46 EET Ville Syrjälä wrote:
Quoted 19 lines · Sinclair Yeh
Quoted 18 lines · Daniel Vetter
Quoted 16 lines · Ville Syrjälä
Quoted 1 line · Sinclair Yeh
Sorry this took so long.
No worries.
Quoted 4 lines
The vmwgfx part: Reviewed-by: Sinclair Yeh <[email protected]>
I've done some testing and the vmwgfx part looks good. Has Daniel already taken these or should I put them in my next request?
You can take them, or I can push them to drm-misc-next. Whatever works best for you.
And I'll want to revisit this topic soonish and move the clip handling into the helper as discussed with Daniel. But that can wait a bit until we get this round merged somewhere.
Quoted 7 lines
Quoted 5 lines
Quoted 3 lines
Because we're still in the merge window I think it's probably best if we push the entire series in through drm-misc. Tree-coordination in the merge window is always a bit a pain.
Ok, so I'll leave this series to you then.
All right. Series pushed to drm-misc-next. Thanks for the reviews.
And I now realize my review comments aren't very useful (apart possibly the one about adding a comment to the drm_plane_helper_check_update() function, feel free to submit a patch for that if you think it's useful) as the series has been merged already :-/ I should really start reading mails in the reverse chronological order.
Signature · 8 lines
Regards, Laurent Pinchart _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel