From: Daniel Vetter <daniel@ffwll.ch>
To: ville.syrjala@linux.intel.com
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm: Set crtc->invert_dimensions from the atomic helpers
Date: Thu, 15 Oct 2015 16:29:15 +0200 [thread overview]
Message-ID: <20151015142915.GD13786@phenom.ffwll.local> (raw)
In-Reply-To: <1444917181-16139-1-git-send-email-ville.syrjala@linux.intel.com>
On Thu, Oct 15, 2015 at 04:53:00PM +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Pull the crtc->invert_dimensions setting from omapdrm into the atomic
> helpers so that all drivers will check viewport correctly in setcrtc()
> after rotating the primary plane,
>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/drm_atomic_helper.c | 8 ++++++++
> drivers/gpu/drm/omapdrm/omap_crtc.c | 3 ---
> 2 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
> index 87a2a44..d0d11dbf 100644
> --- a/drivers/gpu/drm/drm_atomic_helper.c
> +++ b/drivers/gpu/drm/drm_atomic_helper.c
> @@ -1272,6 +1272,11 @@ void drm_atomic_helper_commit_planes(struct drm_device *dev,
>
> funcs->atomic_flush(crtc, old_crtc_state);
> }
> +
> + for_each_crtc_in_state(old_state, crtc, old_crtc_state, i) {
> + crtc->invert_dimensions = (crtc->primary->state->rotation &
> + (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)));
> + }
> }
> EXPORT_SYMBOL(drm_atomic_helper_commit_planes);
>
> @@ -1330,6 +1335,9 @@ drm_atomic_helper_commit_planes_on_crtc(struct drm_crtc_state *old_crtc_state)
>
> if (crtc_funcs && crtc_funcs->atomic_flush)
> crtc_funcs->atomic_flush(crtc, old_crtc_state);
> +
> + crtc->invert_dimensions = (crtc->primary->state->rotation &
> + (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)));
This is racy for async atomic commits since it's only set in the tail part
of the commit, but we read it synchronously from ioctl code. So we'd need
to either state-ify this properly or do something else. Best might be to
ditch crtc->invert_dimensions (so no non-atomic driver uses it), push the
check for legacy drivers down into driver callbacks and for atomic drivers
into the generic check parts of drm_atomic_check.
Not pretty, but probably about the best we can do.
-Daniel
> }
> EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc);
>
> diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c
> index 9a4ba4f..ad09590 100644
> --- a/drivers/gpu/drm/omapdrm/omap_crtc.c
> +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c
> @@ -412,9 +412,6 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc,
> dispc_mgr_go(omap_crtc->channel);
> omap_irq_register(crtc->dev, &omap_crtc->vblank_irq);
> }
> -
> - crtc->invert_dimensions = !!(crtc->primary->state->rotation &
> - (BIT(DRM_ROTATE_90) | BIT(DRM_ROTATE_270)));
> }
>
> static int omap_crtc_atomic_set_property(struct drm_crtc *crtc,
> --
> 2.4.9
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://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
http://lists.freedesktop.org/mailman/listinfo/dri-devel
prev parent reply other threads:[~2015-10-15 14:26 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-15 13:53 [PATCH 1/2] drm: Set crtc->invert_dimensions from the atomic helpers ville.syrjala
2015-10-15 13:53 ` [PATCH 2/2] drm: Swap w/h when converting the mode to src coordidates for a rotated primary plane ville.syrjala
2015-10-15 14:29 ` Daniel Vetter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20151015142915.GD13786@phenom.ffwll.local \
--to=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=ville.syrjala@linux.intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox