From: Thomas Zimmermann Subject: Re: [PATCH 1/2] drm/vram: store dumb bo dimensions. Date: Thu, 27 Jun 2019 09:57:28 +0200 Message-ID: References: <20190626065551.12956-1-kraxel@redhat.com> <20190626065551.12956-2-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="PNZhXJOw24KwAY0OqG7FiAQoGizuOrBiS" Return-path: In-Reply-To: <20190626065551.12956-2-kraxel@redhat.com> Sender: linux-kernel-owner@vger.kernel.org To: Gerd Hoffmann , dri-devel@lists.freedesktop.org Cc: Maxime Ripard , open list , David Airlie , Sean Paul List-Id: dri-devel@lists.freedesktop.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --PNZhXJOw24KwAY0OqG7FiAQoGizuOrBiS Content-Type: multipart/mixed; boundary="i9KRYARTXh1fZn7QNWgDqOZhwcb3zjCkB"; protected-headers="v1" From: Thomas Zimmermann To: Gerd Hoffmann , dri-devel@lists.freedesktop.org Cc: Maxime Ripard , open list , David Airlie , Sean Paul Message-ID: Subject: Re: [PATCH 1/2] drm/vram: store dumb bo dimensions. References: <20190626065551.12956-1-kraxel@redhat.com> <20190626065551.12956-2-kraxel@redhat.com> In-Reply-To: <20190626065551.12956-2-kraxel@redhat.com> --i9KRYARTXh1fZn7QNWgDqOZhwcb3zjCkB Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 26.06.19 um 08:55 schrieb Gerd Hoffmann: > Store width and height of the bo. Needed in case userspace > sets up a framebuffer with fb->width !=3D bo->width.. This seems like bug. I'd rather return an error to userspace if the BO is incompatible. For the Gnome issue, a fix would be to program the display HW's line pitch to the correct value. Best regards Thomas > Signed-off-by: Gerd Hoffmann > --- > include/drm/drm_gem_vram_helper.h | 1 + > drivers/gpu/drm/drm_gem_vram_helper.c | 2 ++ > 2 files changed, 3 insertions(+) >=20 > diff --git a/include/drm/drm_gem_vram_helper.h b/include/drm/drm_gem_vr= am_helper.h > index 1a0ea18e7a74..3692dba167df 100644 > --- a/include/drm/drm_gem_vram_helper.h > +++ b/include/drm/drm_gem_vram_helper.h > @@ -39,6 +39,7 @@ struct drm_gem_vram_object { > struct drm_gem_object gem; > struct ttm_buffer_object bo; > struct ttm_bo_kmap_obj kmap; > + unsigned int width, height; > =20 > /* Supported placements are %TTM_PL_VRAM and %TTM_PL_SYSTEM */ > struct ttm_placement placement; > diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/dr= m_gem_vram_helper.c > index 4de782ca26b2..c02bf7694117 100644 > --- a/drivers/gpu/drm/drm_gem_vram_helper.c > +++ b/drivers/gpu/drm/drm_gem_vram_helper.c > @@ -377,6 +377,8 @@ int drm_gem_vram_fill_create_dumb(struct drm_file *= file, > gbo =3D drm_gem_vram_create(dev, bdev, size, pg_align, interruptible)= ; > if (IS_ERR(gbo)) > return PTR_ERR(gbo); > + gbo->width =3D args->width; > + gbo->height =3D args->height; > =20 > ret =3D drm_gem_handle_create(file, &gbo->gem, &handle); > if (ret) >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Linux GmbH, Maxfeldstrasse 5, 90409 Nuernberg, Germany GF: Felix Imend=C3=B6rffer, Mary Higgins, Sri Rasiah HRB 21284 (AG N=C3=BCrnberg) --i9KRYARTXh1fZn7QNWgDqOZhwcb3zjCkB-- --PNZhXJOw24KwAY0OqG7FiAQoGizuOrBiS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl0UdugACgkQaA3BHVML eiMtjQf8CxTl5L3xNbrgYeDJOsnk5yrqTOJWx3K9bYD9tX2RdJJvpBqOi4Zzn2VP P4xktt1sa4DBhoZZSc41IEe2n6Vfwlm9OrFuONMcJVaBV7DsUHeBXc5Z3QJ2xjZ2 h98mh4VUHBFFWrn5Zezx6OMGAXigJYIInhk0x9GncUQP+239XaL7MnuffYWhC2ym OKOethtUOLU6RTe6x8gYs80fHZ4KDfo1rLPJfoIdj/oqmZby+0b+rzmBuGHcf1V7 Zb8GQfZQfMCtR9pKrCxRgTr6vu4x4D1bMdYcuDQ2lflzgxU1PndFrgnF132OXRzN puGViOo9KBS53l+LSg8UK+9EcPfOjw== =dxqA -----END PGP SIGNATURE----- --PNZhXJOw24KwAY0OqG7FiAQoGizuOrBiS--