From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thierry Reding Subject: Re: [PATCH 1/3] drm/crtc: Add property for aspect ratio Date: Thu, 22 May 2014 13:38:06 +0200 Message-ID: <20140522113805.GA31378@ulmo> References: <1400757650-28636-1-git-send-email-vandana.kannan@intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2128723605==" Return-path: In-Reply-To: <1400757650-28636-1-git-send-email-vandana.kannan@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Vandana Kannan Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org --===============2128723605== Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="C7zPtVaVf+AK4Oqc" Content-Disposition: inline --C7zPtVaVf+AK4Oqc Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 22, 2014 at 04:50:48PM +0530, Vandana Kannan wrote: > Added a property to enable user space to set aspect ratio. > This patch contains declaration of the property and code to create the > property. >=20 > Signed-off-by: Vandana Kannan > Cc: dri-devel@lists.freedesktop.org > --- > drivers/gpu/drm/drm_crtc.c | 31 +++++++++++++++++++++++++++++++ > include/drm/drm_crtc.h | 2 ++ > 2 files changed, 33 insertions(+) >=20 > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > index 37a3e07..84d359e 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -139,6 +139,12 @@ static const struct drm_prop_enum_list drm_scaling_m= ode_enum_list[] =3D > { DRM_MODE_SCALE_ASPECT, "Full aspect" }, > }; > =20 > +static const struct drm_prop_enum_list drm_aspect_ratio_enum_list[] =3D { > + { HDMI_PICTURE_ASPECT_NONE, "Automatic" }, > + { HDMI_PICTURE_ASPECT_4_3, "4:3" }, > + { HDMI_PICTURE_ASPECT_16_9, "16:9" }, > +}; This seems like it should be either an HDMI specific property, since it uses values defined by HDMI/CEA. Alternatively we could introduce some new generic enumeration and translate that to the HDMI/CEA equivalent in the AVI infoframe helpers. Doing so would allow us to add aspect ratios different from what HDMI or CEA define. > /* > * Non-global properties, but "required" for certain connectors. > */ > @@ -1344,6 +1350,31 @@ int drm_mode_create_scaling_mode_property(struct d= rm_device *dev) > EXPORT_SYMBOL(drm_mode_create_scaling_mode_property); > =20 > /** > + * drm_mode_create_aspect_ratio_property - create aspect ratio property > + * @dev: DRM device > + * > + * Called by a driver the first time it's needed, must be attached to de= sired > + * connectors. > + */ > +int drm_mode_create_aspect_ratio_property(struct drm_device *dev) > +{ > + struct drm_property *aspect_ratio; > + > + if (dev->mode_config.aspect_ratio_property) > + return 0; > + > + aspect_ratio =3D > + drm_property_create_enum(dev, 0, "aspect ratio", > + drm_aspect_ratio_enum_list, > + ARRAY_SIZE(drm_aspect_ratio_enum_list)); > + > + dev->mode_config.aspect_ratio_property =3D aspect_ratio; I don't think you need the temporary aspect_ratio variable here. Can't you directly assign the new property to .aspect_ratio_property? Thierry --C7zPtVaVf+AK4Oqc Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) iQIcBAEBAgAGBQJTfeGdAAoJEN0jrNd/PrOhVO0P/2xRWEB4S76rzuh3DofdxoM0 gWJlaDoE0Adr19tYgqkVkjTSndWG2O6rfac1wWM/FhcCnn0v8H7sXYq7hUfrqMFN X+m9UJXFFSrNza02S7Pry4gZ4xsKMKFnEjV/nF2Fdew09lSBKf3HXDP/JllHdV+P GMUMCxbjVB2+AobPCRIu+ekBuQqYDPYsN2k63MeoJiQHZ9QnJ8CCi9g1OvheBNv7 cMPHjf9lRRSvVtBEloBloR0XJiKZldJt0KOIt64hWbmwsGZhZewJs9bI13U6GHPy twCDV4N+jPEewoDcF25oJQjNl4gWJ+256QvSzNhys5b/vITQ2xFGK0TaXxIGQw6i YW1lVms11+jmybL+LjDgPT8omn162BoHtaFoX91KRfY7dnsR9C0T3nuFuoCKXsaL xV8Fu5mHEQWIB7XfWtfll0he4Z0skDvrrztip/acnEN8oh2miAIsHtvUP9J7lkzR VnU+T+PfzeAAJbFF9TAQ5yllTx6R1iXdfCDS2LY2TwLqQ8jHeHztCwEMj3leM6k+ MeRQyANLly5fqUc2rualSdXFdg16u7EfgEXXfr/VGa2USAteyNC8tXV1PU9fT3EA a8y23aQqpPCJWIJWzxdHWukyVp3ehBrsLSPnh6vS+LycrvYXXI9Ou9L3fiY3tGQu /foNb3C/fa77PReOXX46 =dL6Q -----END PGP SIGNATURE----- --C7zPtVaVf+AK4Oqc-- --===============2128723605== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============2128723605==--