From: Thomas Zimmermann Subject: Re: [PATCH v3 1/5] gem/vram: pin to vram in vmap Date: Thu, 27 Jun 2019 16:37:23 +0200 Message-ID: <8a52b578-b255-3e11-3a0c-0b68f0cb649e@suse.de> References: <20190627122348.5833-1-kraxel@redhat.com> <20190627122348.5833-2-kraxel@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0829657603==" Return-path: Received: from mx1.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5D7676E4E1 for ; Thu, 27 Jun 2019 14:37:29 +0000 (UTC) In-Reply-To: <20190627122348.5833-2-kraxel@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Gerd Hoffmann , dri-devel@lists.freedesktop.org Cc: Maxime Ripard , David Airlie , Sean Paul , open list List-Id: dri-devel@lists.freedesktop.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============0829657603== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FgEBem4jKFe78ayhhpxGcdcl9SQIEMWeE" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --FgEBem4jKFe78ayhhpxGcdcl9SQIEMWeE Content-Type: multipart/mixed; boundary="r18lT2MUcokctyjlOfA4f4xehRVx11tdy"; 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: <8a52b578-b255-3e11-3a0c-0b68f0cb649e@suse.de> Subject: Re: [PATCH v3 1/5] gem/vram: pin to vram in vmap References: <20190627122348.5833-1-kraxel@redhat.com> <20190627122348.5833-2-kraxel@redhat.com> In-Reply-To: <20190627122348.5833-2-kraxel@redhat.com> --r18lT2MUcokctyjlOfA4f4xehRVx11tdy Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Am 27.06.19 um 14:23 schrieb Gerd Hoffmann: > drm clients like the generic framebuffer emulation keep a permanent > vmap active, which in turn has a permanent pin. This pin needs to > be in vram, otherwise we can't display the framebuffer. >=20 > Signed-off-by: Gerd Hoffmann > --- > drivers/gpu/drm/drm_gem_vram_helper.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/dr= m_gem_vram_helper.c > index 4de782ca26b2..c724876c6f2a 100644 > --- a/drivers/gpu/drm/drm_gem_vram_helper.c > +++ b/drivers/gpu/drm/drm_gem_vram_helper.c > @@ -592,7 +592,7 @@ void *drm_gem_vram_driver_gem_prime_vmap(struct drm= _gem_object *gem) > int ret; > void *base; > =20 > - ret =3D drm_gem_vram_pin(gbo, 0); > + ret =3D drm_gem_vram_pin(gbo, DRM_GEM_VRAM_PL_FLAG_VRAM); I have a patch set that converts ast and mgag200 to generic framebuffer emulation with a shadow FB. The actual BO is mapped by the fbdev code on demand to update its content. Permanently mapping the fb console's BO would consume too much display memory. This requires the pin function's placement flag to be 0, so the BO is mapped in system memory by default. The proposed patch breaks this. Some ideas for solving this: 1) Introduce a default_placement field in struct drm_gem_vram_helper where this flag can be configured. I'd favor this option. 2) Introduce a separate callback function for pinning to vram. The driver would have to set the correct function pointers. 3) Pin the fb console buffer manually from within the bochs driver. Best regards Thomas > if (ret) > return NULL; > base =3D drm_gem_vram_kmap(gbo, true, NULL); >=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) --r18lT2MUcokctyjlOfA4f4xehRVx11tdy-- --FgEBem4jKFe78ayhhpxGcdcl9SQIEMWeE Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl0U1KYACgkQaA3BHVML eiNZ/Af9GJVlB6AmshA0bhFsXcLcJtL2JFVBIrT7KVI2N+SzdNurOHEjgebgrtJW a/QtPZNj/LuCy47s7CgCPPkd8zLuT05B2gwCGGvoUUs6TOQluBvk0LVj5LQjtju9 zfZMP2JadLLFRtIcZxrRBJhdY6V22mz9F9TyUzrRjjSx58ANWWnd3oEmJoFZObaG qqmxtNCnzkYWZSkDhGyXIIHRKMmUOyaoGbibKX2JIAs45shwplnPDiNtrOQQf86R Z3jzEWgqlvQIWO0GqWvcSmH/Dn7Ehrci0nSPAJ/8+ubT0rkJui1mXwoLO83C099i V9pNLzX4xn/6M3kzmiqNqzrD1edpAg== =XfiM -----END PGP SIGNATURE----- --FgEBem4jKFe78ayhhpxGcdcl9SQIEMWeE-- --===============0829657603== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVs --===============0829657603==--