Re: [PATCH 4/5] drm/armada: Use drm_mode_get_hv_timing() to populate plane clip rectangle
On Mon, Mar 05, 2018 at 09:41:43AM +0100, Daniel Vetter wrote: > On Tue, Jan 23, 2018 at 07:08:56PM +0200, Ville Syrjala wrote: > > From: Ville Syrjälä > > > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > > > Since armada isn't atomic we'll use crtc->enabled and crtc->mode instead > > of the stuff under crtc_state. > > > > Once everyone agrees on how the clip rectangle gets set up we can > > move the code into drm_atomic_helper_check_plane_state(). > > > > Cc: Dave Airlie > > Cc: Russell King > > Signed-off-by: Ville Syrjälä > > For patches 3&4: Reviewed-by: Daniel Vetter > > In case they do unexpectly break armada we can always just copypaste the > previous version of the non-atomic helper into armada code to fix any > regressions cropping up, so I don't see any big risks here. And I'd like > to get this cleanup merged, just stumbled over it again. > > I pinged Dave Airlie on irc, and he's fine with that approach too. > > Acked-by: Dave Airlie > > for the same two patches. Cool. Thank you both. Remainder of the series pushed to drm-misc-next. -- Ville Syrjälä Intel OTC ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH 4/5] drm/armada: Use drm_mode_get_hv_timing() to populate plane clip rectangle
On Tue, Jan 23, 2018 at 07:08:56PM +0200, Ville Syrjala wrote: > From: Ville Syrjälä > > Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. > > Since armada isn't atomic we'll use crtc->enabled and crtc->mode instead > of the stuff under crtc_state. > > Once everyone agrees on how the clip rectangle gets set up we can > move the code into drm_atomic_helper_check_plane_state(). > > Cc: Dave Airlie > Cc: Russell King > Signed-off-by: Ville Syrjälä For patches 3&4: Reviewed-by: Daniel Vetter In case they do unexpectly break armada we can always just copypaste the previous version of the non-atomic helper into armada code to fix any regressions cropping up, so I don't see any big risks here. And I'd like to get this cleanup merged, just stumbled over it again. I pinged Dave Airlie on irc, and he's fine with that approach too. Acked-by: Dave Airlie for the same two patches. -Daniel > --- > drivers/gpu/drm/armada/armada_crtc.c| 9 + > drivers/gpu/drm/armada/armada_overlay.c | 9 + > 2 files changed, 10 insertions(+), 8 deletions(-) > > diff --git a/drivers/gpu/drm/armada/armada_crtc.c > b/drivers/gpu/drm/armada/armada_crtc.c > index 9621ed5d3f98..fdc34ad4ca62 100644 > --- a/drivers/gpu/drm/armada/armada_crtc.c > +++ b/drivers/gpu/drm/armada/armada_crtc.c > @@ -1204,12 +1204,13 @@ static int armada_drm_primary_update(struct drm_plane > *plane, > .crtc = crtc, > .enable = crtc->enabled, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > + struct drm_rect clip = {}; > int ret; > > + if (crtc->enabled) > + drm_mode_get_hv_timing(&crtc->mode, > +&clip.x2, &clip.y2); > + > ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0, > INT_MAX, true, false); > if (ret) > diff --git a/drivers/gpu/drm/armada/armada_overlay.c > b/drivers/gpu/drm/armada/armada_overlay.c > index 825cb642b55e..4f2a7a6e0fd3 100644 > --- a/drivers/gpu/drm/armada/armada_overlay.c > +++ b/drivers/gpu/drm/armada/armada_overlay.c > @@ -209,16 +209,17 @@ armada_ovl_plane_update(struct drm_plane *plane, struct > drm_crtc *crtc, > .crtc = crtc, > .enable = crtc->enabled, > }; > - const struct drm_rect clip = { > - .x2 = crtc->mode.hdisplay, > - .y2 = crtc->mode.vdisplay, > - }; > + struct drm_rect clip = {}; > int ret; > > trace_armada_ovl_plane_update(plane, crtc, fb, >crtc_x, crtc_y, crtc_w, crtc_h, >src_x, src_y, src_w, src_h); > > + if (crtc->enabled) > + drm_mode_get_hv_timing(&crtc->mode, > +&clip.x2, &clip.y2); > + > ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0, > INT_MAX, true, false); > if (ret) > -- > 2.13.6 > > ___ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel
[PATCH 4/5] drm/armada: Use drm_mode_get_hv_timing() to populate plane clip rectangle
From: Ville Syrjälä Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Since armada isn't atomic we'll use crtc->enabled and crtc->mode instead of the stuff under crtc_state. Once everyone agrees on how the clip rectangle gets set up we can move the code into drm_atomic_helper_check_plane_state(). Cc: Dave Airlie Cc: Russell King Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/armada/armada_crtc.c| 9 + drivers/gpu/drm/armada/armada_overlay.c | 9 + 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/armada/armada_crtc.c b/drivers/gpu/drm/armada/armada_crtc.c index 9621ed5d3f98..fdc34ad4ca62 100644 --- a/drivers/gpu/drm/armada/armada_crtc.c +++ b/drivers/gpu/drm/armada/armada_crtc.c @@ -1204,12 +1204,13 @@ static int armada_drm_primary_update(struct drm_plane *plane, .crtc = crtc, .enable = crtc->enabled, }; - const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - }; + struct drm_rect clip = {}; int ret; + if (crtc->enabled) + drm_mode_get_hv_timing(&crtc->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0, INT_MAX, true, false); if (ret) diff --git a/drivers/gpu/drm/armada/armada_overlay.c b/drivers/gpu/drm/armada/armada_overlay.c index 825cb642b55e..4f2a7a6e0fd3 100644 --- a/drivers/gpu/drm/armada/armada_overlay.c +++ b/drivers/gpu/drm/armada/armada_overlay.c @@ -209,16 +209,17 @@ armada_ovl_plane_update(struct drm_plane *plane, struct drm_crtc *crtc, .crtc = crtc, .enable = crtc->enabled, }; - const struct drm_rect clip = { - .x2 = crtc->mode.hdisplay, - .y2 = crtc->mode.vdisplay, - }; + struct drm_rect clip = {}; int ret; trace_armada_ovl_plane_update(plane, crtc, fb, crtc_x, crtc_y, crtc_w, crtc_h, src_x, src_y, src_w, src_h); + if (crtc->enabled) + drm_mode_get_hv_timing(&crtc->mode, + &clip.x2, &clip.y2); + ret = drm_atomic_helper_check_plane_state(&state, &crtc_state, &clip, 0, INT_MAX, true, false); if (ret) -- 2.13.6 ___ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel