Re: [Intel-gfx] [PATCH v2 07/15] drm/omap: Use per-plane rotation property
On 06/10/16 13:30, Ville Syrjälä wrote: > On Thu, Oct 06, 2016 at 12:59:17PM +0300, Tomi Valkeinen wrote: >> >> On 26/09/16 19:30, ville.syrj...@linux.intel.com wrote: >>> From: Ville Syrjälä >>> >>> The global mode_config.rotation_property is going away, switch over to >>> per-plane rotation_property. >>> >>> Not sure I got the annoying crtc rotation_property handling right. >>> Might work, or migth not. >>> >>> v2: Drop the BIT() >>> Don't create rotation property twice for each primary plane >>> >>> Cc: Tomi Valkeinen >>> Cc: Rob Clark >>> Signed-off-by: Ville Syrjälä >>> --- >> >> >>> diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c >>> b/drivers/gpu/drm/omapdrm/omap_plane.c >>> index 6ddaa5ea4b6b..b272f810989e 100644 >>> --- a/drivers/gpu/drm/omapdrm/omap_plane.c >>> +++ b/drivers/gpu/drm/omapdrm/omap_plane.c >>> @@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane >>> *plane, >>> struct omap_drm_private *priv = dev->dev_private; >>> >>> if (priv->has_dmm) { >>> - struct drm_property *prop = dev->mode_config.rotation_property; >>> - >>> - drm_object_attach_property(obj, prop, DRM_ROTATE_0); >>> + if (!plane->rotation_property) >>> + drm_plane_create_rotation_property(plane, >>> + DRM_ROTATE_0, >>> + DRM_ROTATE_0 | >>> DRM_ROTATE_90 | >>> + DRM_ROTATE_180 | >>> DRM_ROTATE_270 | >>> + DRM_REFLECT_X | >>> DRM_REFLECT_Y); >>> + >>> + if (plane->rotation_property && obj != &plane->base) >>> + drm_object_attach_property(obj, >>> plane->rotation_property, >>> + DRM_ROTATE_0); >> >> I think this could use a short comment, as it's not obvious wth is going >> on here =). > > /* Attach the rotation property also to the crtc object */ ? Yes, sounds fine to me. Tomi signature.asc Description: OpenPGP digital signature ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v2 07/15] drm/omap: Use per-plane rotation property
On Thu, Oct 06, 2016 at 12:59:17PM +0300, Tomi Valkeinen wrote: > > On 26/09/16 19:30, ville.syrj...@linux.intel.com wrote: > > From: Ville Syrjälä > > > > The global mode_config.rotation_property is going away, switch over to > > per-plane rotation_property. > > > > Not sure I got the annoying crtc rotation_property handling right. > > Might work, or migth not. > > > > v2: Drop the BIT() > > Don't create rotation property twice for each primary plane > > > > Cc: Tomi Valkeinen > > Cc: Rob Clark > > Signed-off-by: Ville Syrjälä > > --- > > > > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c > > b/drivers/gpu/drm/omapdrm/omap_plane.c > > index 6ddaa5ea4b6b..b272f810989e 100644 > > --- a/drivers/gpu/drm/omapdrm/omap_plane.c > > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c > > @@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane > > *plane, > > struct omap_drm_private *priv = dev->dev_private; > > > > if (priv->has_dmm) { > > - struct drm_property *prop = dev->mode_config.rotation_property; > > - > > - drm_object_attach_property(obj, prop, DRM_ROTATE_0); > > + if (!plane->rotation_property) > > + drm_plane_create_rotation_property(plane, > > + DRM_ROTATE_0, > > + DRM_ROTATE_0 | > > DRM_ROTATE_90 | > > + DRM_ROTATE_180 | > > DRM_ROTATE_270 | > > + DRM_REFLECT_X | > > DRM_REFLECT_Y); > > + > > + if (plane->rotation_property && obj != &plane->base) > > + drm_object_attach_property(obj, > > plane->rotation_property, > > + DRM_ROTATE_0); > > I think this could use a short comment, as it's not obvious wth is going > on here =). /* Attach the rotation property also to the crtc object */ ? > > Otherwise both omap patches look fine, and test fine. > > Reviewed-by: Tomi Valkeinen > > Tomi > -- Ville Syrjälä Intel OTC ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Re: [Intel-gfx] [PATCH v2 07/15] drm/omap: Use per-plane rotation property
On 26/09/16 19:30, ville.syrj...@linux.intel.com wrote: > From: Ville Syrjälä > > The global mode_config.rotation_property is going away, switch over to > per-plane rotation_property. > > Not sure I got the annoying crtc rotation_property handling right. > Might work, or migth not. > > v2: Drop the BIT() > Don't create rotation property twice for each primary plane > > Cc: Tomi Valkeinen > Cc: Rob Clark > Signed-off-by: Ville Syrjälä > --- > diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c > b/drivers/gpu/drm/omapdrm/omap_plane.c > index 6ddaa5ea4b6b..b272f810989e 100644 > --- a/drivers/gpu/drm/omapdrm/omap_plane.c > +++ b/drivers/gpu/drm/omapdrm/omap_plane.c > @@ -211,9 +211,16 @@ void omap_plane_install_properties(struct drm_plane > *plane, > struct omap_drm_private *priv = dev->dev_private; > > if (priv->has_dmm) { > - struct drm_property *prop = dev->mode_config.rotation_property; > - > - drm_object_attach_property(obj, prop, DRM_ROTATE_0); > + if (!plane->rotation_property) > + drm_plane_create_rotation_property(plane, > +DRM_ROTATE_0, > +DRM_ROTATE_0 | > DRM_ROTATE_90 | > +DRM_ROTATE_180 | > DRM_ROTATE_270 | > +DRM_REFLECT_X | > DRM_REFLECT_Y); > + > + if (plane->rotation_property && obj != &plane->base) > + drm_object_attach_property(obj, > plane->rotation_property, > +DRM_ROTATE_0); I think this could use a short comment, as it's not obvious wth is going on here =). Otherwise both omap patches look fine, and test fine. Reviewed-by: Tomi Valkeinen Tomi signature.asc Description: OpenPGP digital signature ___ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx
[Intel-gfx] [PATCH v2 07/15] drm/omap: Use per-plane rotation property
From: Ville Syrjälä The global mode_config.rotation_property is going away, switch over to per-plane rotation_property. Not sure I got the annoying crtc rotation_property handling right. Might work, or migth not. v2: Drop the BIT() Don't create rotation property twice for each primary plane Cc: Tomi Valkeinen Cc: Rob Clark Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/omapdrm/omap_crtc.c | 13 - drivers/gpu/drm/omapdrm/omap_drv.c | 52 +--- drivers/gpu/drm/omapdrm/omap_plane.c | 13 ++--- 3 files changed, 40 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdrm/omap_crtc.c index 180f644e861e..16c691dbc372 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -438,13 +438,14 @@ static void omap_crtc_atomic_flush(struct drm_crtc *crtc, } } -static bool omap_crtc_is_plane_prop(struct drm_device *dev, +static bool omap_crtc_is_plane_prop(struct drm_crtc *crtc, struct drm_property *property) { + struct drm_device *dev = crtc->dev; struct omap_drm_private *priv = dev->dev_private; return property == priv->zorder_prop || - property == dev->mode_config.rotation_property; + property == crtc->primary->rotation_property; } static int omap_crtc_atomic_set_property(struct drm_crtc *crtc, @@ -452,9 +453,7 @@ static int omap_crtc_atomic_set_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t val) { - struct drm_device *dev = crtc->dev; - - if (omap_crtc_is_plane_prop(dev, property)) { + if (omap_crtc_is_plane_prop(crtc, property)) { struct drm_plane_state *plane_state; struct drm_plane *plane = crtc->primary; @@ -479,9 +478,7 @@ static int omap_crtc_atomic_get_property(struct drm_crtc *crtc, struct drm_property *property, uint64_t *val) { - struct drm_device *dev = crtc->dev; - - if (omap_crtc_is_plane_prop(dev, property)) { + if (omap_crtc_is_plane_prop(crtc, property)) { /* * Delegate property get to the primary plane. The * drm_atomic_plane_get_property() function isn't exported, but diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index ae7f9c099aa0..05cd2cf67ea3 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -292,16 +292,6 @@ static int omap_modeset_init_properties(struct drm_device *dev) { struct omap_drm_private *priv = dev->dev_private; - if (priv->has_dmm) { - dev->mode_config.rotation_property = - drm_mode_create_rotation_property(dev, - DRM_ROTATE_0 | DRM_ROTATE_90 | - DRM_ROTATE_180 | DRM_ROTATE_270 | - DRM_REFLECT_X | DRM_REFLECT_Y); - if (!dev->mode_config.rotation_property) - return -ENOMEM; - } - priv->zorder_prop = drm_property_create_range(dev, 0, "zorder", 0, 3); if (!priv->zorder_prop) return -ENOMEM; @@ -752,24 +742,32 @@ static void dev_lastclose(struct drm_device *dev) DBG("lastclose: dev=%p", dev); - if (dev->mode_config.rotation_property) { - /* need to restore default rotation state.. not sure -* if there is a cleaner way to restore properties to -* default state? Maybe a flag that properties should -* automatically be restored to default state on -* lastclose? -*/ - for (i = 0; i < priv->num_crtcs; i++) { - drm_object_property_set_value(&priv->crtcs[i]->base, - dev->mode_config.rotation_property, - DRM_ROTATE_0); - } + /* need to restore default rotation state.. not sure +* if there is a cleaner way to restore properties to +* default state? Maybe a flag that properties should +* automatically be restored to default state on +* lastclose? +*/ + for (i = 0; i < priv->num_crtcs; i++) { + struct drm_crtc *crtc = priv->crtcs[i]; - for (i = 0; i < priv->num_planes; i++) { - drm_object_property_set_value(&priv->planes[i]->base, - dev->mode_config.rotation_property, - DRM_ROTATE_0); - } + if (!crtc->primary->rotation_property) + continue; + + drm_object_property_set_value(&crtc->base, +