From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tomi Valkeinen Subject: Re: [PATCH] drm/omap: move rotation property to drm core mode_config Date: Tue, 30 Sep 2014 15:15:07 +0300 Message-ID: <542A9ECB.5080506@ti.com> References: <1407314424-8573-1-git-send-email-daniel.vetter@ffwll.ch> <542A9709.8070708@ti.com> <20140930114920.GL24667@phenom.ffwll.local> <20140930115205.GM24667@phenom.ffwll.local> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0808637823==" Return-path: Received: from bear.ext.ti.com (bear.ext.ti.com [192.94.94.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 55D686FB62 for ; Tue, 30 Sep 2014 05:15:14 -0700 (PDT) In-Reply-To: <20140930115205.GM24667@phenom.ffwll.local> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Daniel Vetter Cc: Daniel Vetter , DRI Development List-Id: dri-devel@lists.freedesktop.org --===============0808637823== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="jSaKuGnCohwT15W0L28QueL0xiUoSkh3u" --jSaKuGnCohwT15W0L28QueL0xiUoSkh3u Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable On 30/09/14 14:52, Daniel Vetter wrote: > On Tue, Sep 30, 2014 at 01:49:20PM +0200, Daniel Vetter wrote: >> On Tue, Sep 30, 2014 at 02:42:01PM +0300, Tomi Valkeinen wrote: >>> On 06/08/14 11:40, Daniel Vetter wrote: >>>> This allows us to ditch the driver-private lastclose logic. >>>> >>>> Cc: Tomi Valkeinen >>>> Cc: Rob Clark >>>> Signed-off-by: Daniel Vetter >>>> >>>> -- >>>> >>>> Untested and atm only applies on top of drm-intel-nightly. >>> >>> I could give this a try if you point me to a git tree with the patch.= >> >> I should apply on top of drm-next nowadays, prerequisites that went in= >> through drm-intel are all merged now. I guess you'll take care of this= one >> now? It didn't compile, but it was trivial to fix. And yes, I can pick it to m= y omapdrm patches, which I guess will be delayed until 3.19. > btw if this works you can drop the entire if (rotation_property) hunk f= rom > lastclose, since the fbdev helper now takes care of this itself: >=20 > commit 3a5f87c286515c54ff5c52c3e64d0c522b7570c0 > Author: Thomas Wood > Date: Wed Aug 20 14:45:00 2014 +0100 >=20 > drm: fix plane rotation when restoring fbdev configuration I updated the patch, with the compile fix and removal of the lastclose st= uff. Seems to work fine with a quick test: I exit X (after fiddling with xrand= r rotation in there), and I see the rotation property restored to the defau= lt value. Tomi =46rom afb37e165010fc5f3db82efdec9b883fb578deac Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 6 Aug 2014 10:40:24 +0200 Subject: [PATCH] drm/omap: move rotation property to drm core mode_config= Move rotation property to drm core mode_config. This allows us to ditch the driver-private lastclose logic. Cc: Rob Clark Signed-off-by: Daniel Vetter Signed-off-by: Tomi Valkeinen --- drivers/gpu/drm/omapdrm/omap_crtc.c | 4 ++-- drivers/gpu/drm/omapdrm/omap_drv.c | 20 -------------------- drivers/gpu/drm/omapdrm/omap_drv.h | 1 - drivers/gpu/drm/omapdrm/omap_plane.c | 7 ++++--- 4 files changed, 6 insertions(+), 26 deletions(-) diff --git a/drivers/gpu/drm/omapdrm/omap_crtc.c b/drivers/gpu/drm/omapdr= m/omap_crtc.c index 2d28dc337cfb..1240fa61b397 100644 --- a/drivers/gpu/drm/omapdrm/omap_crtc.c +++ b/drivers/gpu/drm/omapdrm/omap_crtc.c @@ -385,9 +385,9 @@ static int omap_crtc_set_property(struct drm_crtc *cr= tc, struct drm_property *property, uint64_t val) { struct omap_crtc *omap_crtc =3D to_omap_crtc(crtc); - struct omap_drm_private *priv =3D crtc->dev->dev_private; + struct drm_device *dev =3D crtc->dev; =20 - if (property =3D=3D priv->rotation_prop) { + if (property =3D=3D dev->mode_config.rotation_property) { crtc->invert_dimensions =3D !!(val & ((1LL << DRM_ROTATE_90) | (1LL << DRM_ROTATE_270))); } diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm= /omap_drv.c index 862ba03c236c..282f5ec4f1a2 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c @@ -560,8 +560,6 @@ static int dev_open(struct drm_device *dev, struct dr= m_file *file) */ static void dev_lastclose(struct drm_device *dev) { - int i; - /* we don't support vga-switcheroo.. so just make sure the fbdev * mode is active */ @@ -570,24 +568,6 @@ static void dev_lastclose(struct drm_device *dev) =20 DBG("lastclose: dev=3D%p", dev); =20 - if (priv->rotation_prop) { - /* 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 =3D 0; i < priv->num_crtcs; i++) { - drm_object_property_set_value(&priv->crtcs[i]->base, - priv->rotation_prop, 0); - } - - for (i =3D 0; i < priv->num_planes; i++) { - drm_object_property_set_value(&priv->planes[i]->base, - priv->rotation_prop, 0); - } - } - ret =3D drm_fb_helper_restore_fbdev_mode_unlocked(priv->fbdev); if (ret) DBG("failed to restore crtc mode"); diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm= /omap_drv.h index 60e47b33c801..aa596504e662 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h @@ -111,7 +111,6 @@ struct omap_drm_private { bool has_dmm; =20 /* properties: */ - struct drm_property *rotation_prop; struct drm_property *zorder_prop; =20 /* irq handling: */ diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapd= rm/omap_plane.c index 891a4dc608af..3b5fad2a359c 100644 --- a/drivers/gpu/drm/omapdrm/omap_plane.c +++ b/drivers/gpu/drm/omapdrm/omap_plane.c @@ -306,7 +306,7 @@ void omap_plane_install_properties(struct drm_plane *= plane, struct drm_property *prop; =20 if (priv->has_dmm) { - prop =3D priv->rotation_prop; + prop =3D dev->mode_config.rotation_property; if (!prop) { prop =3D drm_mode_create_rotation_property(dev, BIT(DRM_ROTATE_0) | @@ -317,7 +317,7 @@ void omap_plane_install_properties(struct drm_plane *= plane, BIT(DRM_REFLECT_Y)); if (prop =3D=3D NULL) return; - priv->rotation_prop =3D prop; + dev->mode_config.rotation_property =3D prop; } drm_object_attach_property(obj, prop, 0); } @@ -337,9 +337,10 @@ int omap_plane_set_property(struct drm_plane *plane,= { struct omap_plane *omap_plane =3D to_omap_plane(plane); struct omap_drm_private *priv =3D plane->dev->dev_private; + struct drm_device *dev =3D omap_plane->base.dev; int ret =3D -EINVAL; =20 - if (property =3D=3D priv->rotation_prop) { + if (property =3D=3D dev->mode_config.rotation_property) { DBG("%s: rotation: %02x", omap_plane->name, (uint32_t)val); omap_plane->win.rotation =3D val; ret =3D apply(plane); --=20 2.1.1 --jSaKuGnCohwT15W0L28QueL0xiUoSkh3u Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUKp7LAAoJEPo9qoy8lh71r7IP/RdjRXYRTIxjGYrhqIpZPTjO Uiu3d+cH5vdBqZWy1vi00zZ/+1m2hq7foLhIR2IWLX/xmMMSgQoKCjnwT7XDWbWK EnNWBGm/oTD8qOv4hkfb6JzL11dpdja9is5l56XaxqLeDy5b0b+PcDjRS3wZaykM 8k3CvSh9EX6ODrhg1qoQZNmxFz137EeesWN9u4mgWZpjYgwo+giSbQdj4iy7gRRi IXAUQonCBXEfYTbshnKtqROBt/TpUigDGf8hyzw9nwjDcTYplvUOvlt8dJyggBGK 7F2TSdmqu7XsPnbrL/dXIJ30Oh9BghfsNRAzT1KR10wpE7EoA60jlX/2PkaHpm+7 4rS9Nj+LViV6ryIuLTowdrojTjih6iPZMH0wNvIFXc+vIInI9400bYJP8yoUh3VI NwTov+oQnK16dH8pRs6zYuu/ZSRjkfWYjuR1nWBa9tbjzpsrnSxFPIu2zOL6J1Qv lnUz6Kfkuz4z0HaQgRwE1TqPbRnSTBNSqEwQzkTkNsJKo/HDADKYzxX4FHugvW/m 72ejtKgUgNm4ugh7EPzyKEVQ8FEtdwLrPajsfPpXRc7jdSPInuswTi8oP4QVNyu3 SIm7OtnF7jjLGAcwRtvb9eNbuZni5RDGARBKFIWaqlupiMOKICM1lXq/xp4qfRuY kNSglH4zzHOn6oQwz6O+ =usZC -----END PGP SIGNATURE----- --jSaKuGnCohwT15W0L28QueL0xiUoSkh3u-- --===============0808637823== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0808637823==--