From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jesse Barnes Subject: Re: [PATCH 7/7] drm: plane: Check that the fb pixel format is supported by the plane Date: Fri, 11 Nov 2011 08:25:40 -0800 Message-ID: <20111111082540.3e3e18c7@jbarnes-desktop> References: <1321027447-17921-1-git-send-email-ville.syrjala@linux.intel.com> <1321027447-17921-8-git-send-email-ville.syrjala@linux.intel.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1236948395==" Return-path: Received: from oproxy8-pub.bluehost.com (oproxy8-pub.bluehost.com [69.89.22.20]) by gabe.freedesktop.org (Postfix) with SMTP id 9F5EDA0DEF for ; Fri, 11 Nov 2011 08:25:21 -0800 (PST) In-Reply-To: <1321027447-17921-8-git-send-email-ville.syrjala@linux.intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: ville.syrjala@linux.intel.com Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org --===============1236948395== Content-Type: multipart/signed; micalg=PGP-SHA1; boundary="Sig_/fG+P4N2SIsccfSyrSqDdCun"; protocol="application/pgp-signature" --Sig_/fG+P4N2SIsccfSyrSqDdCun Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On Fri, 11 Nov 2011 18:04:07 +0200 ville.syrjala@linux.intel.com wrote: > From: Ville Syrj=E4l=E4 >=20 > Signed-off-by: Ville Syrj=E4l=E4 > --- > drivers/gpu/drm/drm_crtc.c | 11 +++++++++++ > 1 files changed, 11 insertions(+), 0 deletions(-) >=20 > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > index 27d46b1..04680bc 100644 > --- a/drivers/gpu/drm/drm_crtc.c > +++ b/drivers/gpu/drm/drm_crtc.c > @@ -1655,6 +1655,7 @@ int drm_mode_setplane(struct drm_device *dev, void = *data, > struct drm_framebuffer *fb; > int ret =3D 0; > unsigned int fb_width, fb_height; > + int i; > =20 > if (!drm_core_check_feature(dev, DRIVER_MODESET)) > return -EINVAL; > @@ -1703,6 +1704,16 @@ int drm_mode_setplane(struct drm_device *dev, void= *data, > } > fb =3D obj_to_fb(obj); > =20 > + /* Check whether this plane supports the fb pixel format. */ > + for (i =3D 0; i < plane->format_count; i++) > + if (fb->pixel_format =3D=3D plane->format_types[i]) > + break; > + if (i =3D=3D plane->format_count) { > + DRM_DEBUG_KMS("Invalid pixel format %x\n", fb->pixel_format); > + ret =3D -EINVAL; > + goto out; > + } > + > fb_width =3D fb->width << 16; > fb_height =3D fb->height << 16; > =20 Yeah it's reasonable to hoist this up into generic code. Thanks, --=20 Jesse Barnes, Intel Open Source Technology Center --Sig_/fG+P4N2SIsccfSyrSqDdCun Content-Type: application/pgp-signature; name=signature.asc Content-Disposition: attachment; filename=signature.asc -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.10 (GNU/Linux) iQIcBAEBAgAGBQJOvUyEAAoJEIEoDkX4Qk9h//IQAI+gMHm/YxTnE1ZAgZG67iAM G6uCCfqNn46KXrvRi8SV5t2Jd68q73JZDJC4BWFMzOJOsmicp9qC+0euKcgOVyqM X1qxaaOafiuGeYKTvHCQCeLrtJqSBUxHyTPGy22+AObkuwnAVJkeFqPpzJqhttUy 9ASN08kPp8oCVyCVAB2c5fa5fZSEpiQpSad9F8tG+g6ZWBK0HQpdlDLIuLmryYkA 2evKgqyMo4H3Eu5bufMc4vTzkD33hjcpsG9AaO84QnyxNbF/wrI42YGRgzv6wtWL tGR3vcHDkOGnffAUVBuE3ijfHxMafBZZhz0kd8S82m/pDvmTUP5xBmowb23i/V7N hSkQ06Mo6dBocJqu8MaJ5wf7oFhJkdhoixoLqQoaoXxtf3iWxKijBVEk5ggnBYW2 OTtLuw9sWGBmJqIVB9FHCWgogz6/Vm0pO0KUixkB5xPvGHyxJ7mNokb/Chk0FC9c p5Gy76UYDr/OyEwpoXw7Crv8xMFy/U3x8B5FVRgOWedJKG/NyDRmw+Bq6ldGuSws 0itMzTIiOWbtMHHkU1ZsQ5RHBF7qtl6YJ2PRMggVp9nswHyvIOD5ksQLnSr4+iCd dhmpA/7Zxgv3fMgjfVaA3MPIsAy96ZW4Q/LJaq+Dh3G6Y5vGZDpntQl+16kN8XEq u/BE4PXBmADCAVRLXfSA =njol -----END PGP SIGNATURE----- --Sig_/fG+P4N2SIsccfSyrSqDdCun-- --===============1236948395== 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 --===============1236948395==--