public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
To: ville.syrjala@linux.intel.com, intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/7] drm: Add support for optional per-plane rotation property
Date: Wed, 20 Jul 2016 16:51:57 +0300	[thread overview]
Message-ID: <1469022717.11191.6.camel@linux.intel.com> (raw)
In-Reply-To: <1469020693-24356-4-git-send-email-ville.syrjala@linux.intel.com>

On ke, 2016-07-20 at 16:18 +0300, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Not all planes on the ssytem may support the same rotations/reflections,

s/ssytem/system/

> so make it possible to create a separate property for each plane.
> This way userspace gets told exactly which rotations/reflections are
> possible for each plane.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/gpu/drm/drm_atomic.c    | 6 ++++--
>  drivers/gpu/drm/drm_fb_helper.c | 6 +++++-
>  include/drm/drm_crtc.h          | 2 ++
>  3 files changed, 11 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c
> index 5f0002897862..38b023da6f09 100644
> --- a/drivers/gpu/drm/drm_atomic.c
> +++ b/drivers/gpu/drm/drm_atomic.c
> @@ -710,7 +710,8 @@ int drm_atomic_plane_set_property(struct drm_plane *plane,
>  		state->src_w = val;
>  	} else if (property == config->prop_src_h) {
>  		state->src_h = val;
> -	} else if (property == config->rotation_property) {
> +	} else if (property == config->rotation_property ||
> +		   property == plane->rotation_property) {
>  		if (!is_power_of_2(val & DRM_ROTATE_MASK))
>  			return -EINVAL;
>  		state->rotation = val;
> @@ -768,7 +769,8 @@ drm_atomic_plane_get_property(struct drm_plane *plane,
>  		*val = state->src_w;
>  	} else if (property == config->prop_src_h) {
>  		*val = state->src_h;
> -	} else if (property == config->rotation_property) {
> +	} else if (property == config->rotation_property ||
> +		   property == plane->rotation_property) {
>  		*val = state->rotation;
>  	} else if (plane->funcs->atomic_get_property) {
>  		return plane->funcs->atomic_get_property(plane, state, property, val);
> diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c
> index ce54e985d91b..ce536c0553e5 100644
> --- a/drivers/gpu/drm/drm_fb_helper.c
> +++ b/drivers/gpu/drm/drm_fb_helper.c
> @@ -392,7 +392,11 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper)
>  		if (plane->type != DRM_PLANE_TYPE_PRIMARY)
>  			drm_plane_force_disable(plane);
>  
> -		if (dev->mode_config.rotation_property) {
> +		if (plane->rotation_property) {
> +			drm_mode_plane_set_obj_prop(plane,
> +						    plane->rotation_property,
> +						    BIT(DRM_ROTATE_0));
> +		} else if (dev->mode_config.rotation_property) {

Why not clear the mode_config.rotation_property too, still?

Regards, Joonas

>  			drm_mode_plane_set_obj_prop(plane,
>  						    dev->mode_config.rotation_property,
>  						    BIT(DRM_ROTATE_0));
> diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
> index b7ac7dcf52db..8d65e85d6d91 100644
> --- a/include/drm/drm_crtc.h
> +++ b/include/drm/drm_crtc.h
> @@ -1737,6 +1737,8 @@ struct drm_plane {
>  	const struct drm_plane_helper_funcs *helper_private;
>  
>  	struct drm_plane_state *state;
> +
> +	struct drm_property *rotation_property;
>  };
>  
>  /**
-- 
Joonas Lahtinen
Open Source Technology Center
Intel Corporation
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2016-07-20 13:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-20 13:18 [PATCH 0/7] drm/i915: Per-plane rotation, fixes, and mirroring for CHV ville.syrjala
2016-07-20 13:18 ` [PATCH 1/7] drm: Add drm_rotation_90_or_270() ville.syrjala
2016-07-20 13:24   ` Joonas Lahtinen
2016-07-20 13:41   ` [Intel-gfx] " Chris Wilson
2016-07-20 13:18 ` [PATCH 2/7] drm/atomic: Reject attempts to use multiple rotation angles at once ville.syrjala
2016-07-20 13:26   ` Joonas Lahtinen
2016-07-20 13:27   ` Chris Wilson
2016-07-20 13:18 ` [PATCH 3/7] drm: Add support for optional per-plane rotation property ville.syrjala
2016-07-20 13:31   ` [Intel-gfx] " Chris Wilson
2016-07-20 13:51   ` Joonas Lahtinen [this message]
2016-07-20 14:08     ` Ville Syrjälä
2016-07-20 14:13       ` Joonas Lahtinen
2016-07-20 13:18 ` [PATCH 4/7] drm/i915: Use the " ville.syrjala
2016-07-20 13:34   ` Chris Wilson
2016-07-20 13:57   ` Joonas Lahtinen
2016-07-20 14:13     ` Ville Syrjälä
2016-07-20 13:18 ` [PATCH 5/7] drm/i915: Use & instead if == to check for rotations ville.syrjala
2016-07-20 13:35   ` [Intel-gfx] " Chris Wilson
2016-07-20 14:01   ` Joonas Lahtinen
2016-07-20 14:14     ` Ville Syrjälä
2016-07-20 13:18 ` [PATCH 6/7] drm/i915: Clean up rotation DSPCNTR/DVSCNTR/etc. setup ville.syrjala
2016-07-20 13:37   ` Chris Wilson
2016-07-20 14:03   ` Joonas Lahtinen
2016-07-20 13:18 ` [PATCH 7/7] drm/i915: Add horizontal mirroring support for CHV pipe B planes ville.syrjala
2016-07-21 10:30   ` Joonas Lahtinen
2016-07-20 13:18 ` [PATCH i-g-t] tests/kms_rotation_crc: Add bad-rotation subtest ville.syrjala
2016-07-21 10:32   ` Joonas Lahtinen
2016-07-21 11:05     ` Ville Syrjälä
2016-07-22 12:52       ` Matthew Auld
2016-07-22 13:23         ` Ville Syrjälä
2016-07-20 14:17 ` ✓ Ro.CI.BAT: success for drm/i915: Per-plane rotation, fixes, and mirroring for CHV Patchwork

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=1469022717.11191.6.camel@linux.intel.com \
    --to=joonas.lahtinen@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@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