All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Sagar Arun Kamble <sagar.a.kamble@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/5] drm/i915: Rename primary plane rotation property to "plane-rotation"
Date: Thu, 13 Feb 2014 15:46:39 +0200	[thread overview]
Message-ID: <20140213134638.GB3852@intel.com> (raw)
In-Reply-To: <1392295047.28501.37.camel@sagar-desktop>

On Thu, Feb 13, 2014 at 06:07:27PM +0530, Sagar Arun Kamble wrote:
> On Wed, 2014-02-12 at 23:15 +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > I'd prefer have the crtc "rotation" property rotate the entire crtc
> > (planes and all). So for that reason we'd need to come up with some
> > other name for the "rotate the primary plane only" property.
> > 
> > Originally I had though that omapdrm had already made the decision for
> > us, but after another look, it looks like it never attaches the
> > "rotation" property to the crtc. So we can still change the name
> > without any ABI breakage.
> > 
> > Suggestions for better naming scheme are also welcome....
> I would suggest name to be "primary-rotation" or "primary_rotation". It
> seems more aligned to member variable primary_rotation as well.

Well, "primary plane" is an Intel term, so I don't know if other people
would find it sensible. But I guess you can consider any plane "primary"
if it's assigned to act as the crtc scanout engine...

> > 
> > TODO: squash into "drm/i915: Add 180 degree primary plane rotation support"?
> > 
> > Cc: Sagar Kamble <sagar.a.kamble@intel.com>
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/gpu/drm/i915/i915_dma.c      | 11 +++++++----
> >  drivers/gpu/drm/i915/i915_drv.h      |  3 ++-
> >  drivers/gpu/drm/i915/intel_display.c | 28 ++++++++++++++--------------
> >  drivers/gpu/drm/i915/intel_drv.h     |  2 +-
> >  drivers/gpu/drm/i915/intel_pm.c      |  2 +-
> >  5 files changed, 25 insertions(+), 21 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> > index 9232fdf..4a3ef34 100644
> > --- a/drivers/gpu/drm/i915/i915_dma.c
> > +++ b/drivers/gpu/drm/i915/i915_dma.c
> > @@ -1898,13 +1898,16 @@ void i915_driver_lastclose(struct drm_device * dev)
> >  	if (!dev_priv)
> >  		return;
> >  
> > -	if (dev_priv->rotation_property) {
> > +	if (dev_priv->plane_rotation_property) {
> >  		list_for_each_entry(crtc, &dev->mode_config.crtc_list, base.head) {
> > -			crtc->rotation = BIT(DRM_ROTATE_0);
> > +			crtc->primary_rotation = BIT(DRM_ROTATE_0);
> >  			drm_object_property_set_value(&crtc->base.base,
> > -						dev_priv->rotation_property,
> > -						crtc->rotation);
> > +						dev_priv->plane_rotation_property,
> > +						crtc->primary_rotation);
> >  		}
> > +	}
> > +
> > +	if (dev_priv->rotation_property) {
> >  		list_for_each_entry(plane, &dev->mode_config.plane_list, base.head) {
> >  			plane->rotation = BIT(DRM_ROTATE_0);
> >  			drm_object_property_set_value(&plane->base.base,
> > diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> > index 5a46788..6af78ee 100644
> > --- a/drivers/gpu/drm/i915/i915_drv.h
> > +++ b/drivers/gpu/drm/i915/i915_drv.h
> > @@ -1560,7 +1560,8 @@ typedef struct drm_i915_private {
> >  
> >  	struct drm_property *broadcast_rgb_property;
> >  	struct drm_property *force_audio_property;
> > -	struct drm_property *rotation_property;
> > +	struct drm_property *rotation_property; /* "rotation" */
> > +	struct drm_property *plane_rotation_property; /* "plane-rotation" */
> >  
> >  	uint32_t hw_context_size;
> >  	struct list_head context_list;
> > diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> > index bab17fd..37b23d1 100644
> > --- a/drivers/gpu/drm/i915/intel_display.c
> > +++ b/drivers/gpu/drm/i915/intel_display.c
> > @@ -2133,7 +2133,7 @@ static int i9xx_update_plane(struct drm_crtc *crtc, struct drm_framebuffer *fb,
> >  		intel_crtc->dspaddr_offset = linear_offset;
> >  	}
> >  
> > -	if (intel_crtc->rotation == BIT(DRM_ROTATE_180)) {
> > +	if (intel_crtc->primary_rotation == BIT(DRM_ROTATE_180)) {
> >  		dspcntr |= DISPPLANE_ROTATE_180;
> >  
> >  		x += (intel_crtc->config.pipe_src_w - 1);
> > @@ -2238,7 +2238,7 @@ static int ironlake_update_plane(struct drm_crtc *crtc,
> >  					       fb->pitches[0]);
> >  	linear_offset -= intel_crtc->dspaddr_offset;
> >  
> > -	if (intel_crtc->rotation == BIT(DRM_ROTATE_180)) {
> > +	if (intel_crtc->primary_rotation == BIT(DRM_ROTATE_180)) {
> >  		dspcntr |= DISPPLANE_ROTATE_180;
> >  
> >  		if (!IS_HASWELL(dev) && !IS_BROADWELL(dev)) {
> > @@ -8820,13 +8820,13 @@ static int intel_crtc_set_property(struct drm_crtc *crtc,
> >  	uint64_t old_val;
> >  	int ret = -ENOENT;
> >  
> > -	if (prop == dev_priv->rotation_property) {
> > +	if (prop == dev_priv->plane_rotation_property) {
> >  		/* exactly one rotation angle please */
> >  		if (hweight32(val & 0xf) != 1)
> >  			return -EINVAL;
> >  
> > -		old_val = intel_crtc->rotation;
> > -		intel_crtc->rotation = val;
> > +		old_val = intel_crtc->primary_rotation;
> > +		intel_crtc->primary_rotation = val;
> >  
> >  		if (intel_crtc->active) {
> >  			intel_crtc_wait_for_pending_flips(crtc);
> > @@ -8834,12 +8834,12 @@ static int intel_crtc_set_property(struct drm_crtc *crtc,
> >  			/* FBC does not work on some platforms for rotated planes */
> >  			if (dev_priv->fbc.plane == intel_crtc->plane &&
> >  			    INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev) &&
> > -			    intel_crtc->rotation != BIT(DRM_ROTATE_0))
> > +			    intel_crtc->primary_rotation != BIT(DRM_ROTATE_0))
> >  				intel_disable_fbc(dev);
> >  
> >  			ret = dev_priv->display.update_plane(crtc, crtc->fb, 0, 0);
> >  			if (ret)
> > -				intel_crtc->rotation = old_val;
> > +				intel_crtc->primary_rotation = old_val;
> >  		}
> >  	}
> >  
> > @@ -10387,7 +10387,7 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
> >  	 */
> >  	intel_crtc->pipe = pipe;
> >  	intel_crtc->plane = pipe;
> > -	intel_crtc->rotation = BIT(DRM_ROTATE_0);
> > +	intel_crtc->primary_rotation = BIT(DRM_ROTATE_0);
> >  	if (HAS_FBC(dev) && INTEL_INFO(dev)->gen < 4) {
> >  		DRM_DEBUG_KMS("swapping pipes & planes for FBC\n");
> >  		intel_crtc->plane = !pipe;
> > @@ -10399,15 +10399,15 @@ static void intel_crtc_init(struct drm_device *dev, int pipe)
> >  	dev_priv->pipe_to_crtc_mapping[intel_crtc->pipe] = &intel_crtc->base;
> >  
> >  	if (INTEL_INFO(dev)->gen >= 4) {
> > -		if (!dev_priv->rotation_property)
> > -			dev_priv->rotation_property =
> > -				drm_mode_create_rotation_property(dev, "rotation",
> > +		if (!dev_priv->plane_rotation_property)
> > +			dev_priv->plane_rotation_property =
> > +				drm_mode_create_rotation_property(dev, "plane-rotation",
> >  								BIT(DRM_ROTATE_0) |
> >  								BIT(DRM_ROTATE_180));
> > -		if (dev_priv->rotation_property)
> > +		if (dev_priv->plane_rotation_property)
> >  			drm_object_attach_property(&intel_crtc->base.base,
> > -						dev_priv->rotation_property,
> > -						intel_crtc->rotation);
> > +						dev_priv->plane_rotation_property,
> > +						intel_crtc->primary_rotation);
> >  	}
> >  
> >  	drm_crtc_helper_add(&intel_crtc->base, &intel_helper_funcs);
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index 82f0f9a..8c17a82 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -331,7 +331,7 @@ struct intel_crtc {
> >  	struct drm_crtc base;
> >  	enum pipe pipe;
> >  	enum plane plane;
> > -	unsigned int rotation;
> > +	unsigned int primary_rotation; /* primary plane in relation to the pipe */
> >  
> >  	u8 lut_r[256], lut_g[256], lut_b[256];
> >  	/*
> > diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
> > index 9c9ddfe..5ebeb78 100644
> > --- a/drivers/gpu/drm/i915/intel_pm.c
> > +++ b/drivers/gpu/drm/i915/intel_pm.c
> > @@ -558,7 +558,7 @@ void intel_update_fbc(struct drm_device *dev)
> >  	}
> >  
> >  	if (INTEL_INFO(dev)->gen <= 4 && !IS_G4X(dev) &&
> > -	    intel_crtc->rotation != BIT(DRM_ROTATE_0)) {
> > +	    intel_crtc->primary_rotation != BIT(DRM_ROTATE_0)) {
> >  		if (set_no_fbc_reason(dev_priv, FBC_UNSUPPORTED_MODE))
> >  			DRM_DEBUG_KMS("mode incompatible with compression, "
> >  				      "disabling\n");
> 

-- 
Ville Syrjälä
Intel OTC

  reply	other threads:[~2014-02-13 13:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-12 21:14 [PATCH 0/5] drm/i915: Full pipe rotation & rotation property name bikeshedding ville.syrjala
2014-02-12 21:15 ` [PATCH 1/5] drm: Pass name to drm_rotation_property_create() ville.syrjala
2014-02-13 10:42   ` Sagar Arun Kamble
2014-02-12 21:15 ` [PATCH 2/5] drm/i915: Rename primary plane rotation property to "plane-rotation" ville.syrjala
2014-02-13 12:37   ` Sagar Arun Kamble
2014-02-13 13:46     ` Ville Syrjälä [this message]
2014-02-13 14:06       ` Ville Syrjälä
2014-02-13 14:20         ` [Intel-gfx] " Chris Wilson
2014-02-13 14:40           ` Ville Syrjälä
2014-02-12 21:15 ` [PATCH 3/5] drm: Add drm_rotation_chain() ville.syrjala
2014-02-12 21:15 ` [PATCH 4/5] drm/i915: Add rotation support for the cursor plane ville.syrjala
2014-02-14 11:01   ` Sagar Arun Kamble
2014-02-14 11:39     ` Ville Syrjälä
2014-02-17 17:23       ` Sagar Arun Kamble
2014-02-17 17:51         ` Ville Syrjälä
2014-02-18  7:49           ` Sagar Arun Kamble
2014-02-18  9:23             ` Ville Syrjälä
2014-02-18 10:09               ` Sagar Arun Kamble
2014-02-12 21:15 ` [PATCH 5/5] drm/i915: Add full pipe rotation ville.syrjala
2014-02-19 10:25   ` Sagar Arun Kamble
2014-02-12 23:17 ` [PATCH 0/5] drm/i915: Full pipe rotation & rotation property name bikeshedding Chris Wilson
2014-02-13  8:51   ` Ville Syrjälä
2014-02-13 11:20 ` Chris Wilson
2014-02-13 11:58   ` Ville Syrjälä

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=20140213134638.GB3852@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=sagar.a.kamble@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.