From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-11.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDFB8C43616 for ; Fri, 17 Jul 2020 06:26:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BE07020768 for ; Fri, 17 Jul 2020 06:26:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BE07020768 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A1A236E44D; Fri, 17 Jul 2020 06:26:08 +0000 (UTC) Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTPS id BB1A16E44D for ; Fri, 17 Jul 2020 06:26:05 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id C5F56AC20; Fri, 17 Jul 2020 06:26:08 +0000 (UTC) Subject: Re: [PATCH 3/3] drm/vram-helper: Set object function iff they are not provided by driver To: Sam Ravnborg References: <20200714083238.28479-1-tzimmermann@suse.de> <20200714083238.28479-4-tzimmermann@suse.de> <20200716201137.GB2254583@ravnborg.org> From: Thomas Zimmermann Message-ID: <3033edf9-9be5-2c00-4f45-014dba53b17f@suse.de> Date: Fri, 17 Jul 2020 08:26:00 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200716201137.GB2254583@ravnborg.org> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: airlied@linux.ie, jiayang5@huawei.com, dri-devel@lists.freedesktop.org, butterflyhuangxx@gmail.com Content-Type: multipart/mixed; boundary="===============0837391726==" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --===============0837391726== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2tv3b3WAQeXTYgn3JJBGJg9j0IPNhNiFq" This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --2tv3b3WAQeXTYgn3JJBGJg9j0IPNhNiFq Content-Type: multipart/mixed; boundary="aSshCli58I1CzR5W9AIKozTew3qQxg7nF"; protected-headers="v1" From: Thomas Zimmermann To: Sam Ravnborg Cc: jiayang5@huawei.com, airlied@linux.ie, butterflyhuangxx@gmail.com, dri-devel@lists.freedesktop.org Message-ID: <3033edf9-9be5-2c00-4f45-014dba53b17f@suse.de> Subject: Re: [PATCH 3/3] drm/vram-helper: Set object function iff they are not provided by driver References: <20200714083238.28479-1-tzimmermann@suse.de> <20200714083238.28479-4-tzimmermann@suse.de> <20200716201137.GB2254583@ravnborg.org> In-Reply-To: <20200716201137.GB2254583@ravnborg.org> --aSshCli58I1CzR5W9AIKozTew3qQxg7nF Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi Sam Am 16.07.20 um 22:11 schrieb Sam Ravnborg: > On Tue, Jul 14, 2020 at 10:32:38AM +0200, Thomas Zimmermann wrote: >> Don't override the GEM object functions unconditionally. If the driver= >> sets the GEM functions, VRAM helpers will now them. The idea has been > s/now/own Ooops, I forgot a word. This should have been 'will now use them'. >> taken from SHMEM helpers. If drivers need special versions of some of >> the GEM functions, they can now override them. >> >> Signed-off-by: Thomas Zimmermann >> --- >> drivers/gpu/drm/drm_gem_vram_helper.c | 10 ++++++---- >> 1 file changed, 6 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/drm_gem_vram_helper.c b/drivers/gpu/drm/d= rm_gem_vram_helper.c >> index af767d3da5da..7194144610cb 100644 >> --- a/drivers/gpu/drm/drm_gem_vram_helper.c >> +++ b/drivers/gpu/drm/drm_gem_vram_helper.c >> @@ -190,6 +190,7 @@ struct drm_gem_vram_object *drm_gem_vram_create(st= ruct drm_device *dev, >> unsigned long pg_align) >=20 > The documentation of drm_gem_vram_create() could really use some love > here. It should document the behavior around gem_create_object(), and > the default allocation of drm_gem_vram_object with no drm_gem_object > assigned etc. Sure Best regards Thomas >=20 > Sam >=20 >=20 >> { >> struct drm_gem_vram_object *gbo; >> + struct drm_gem_object *gem; >> struct drm_vram_mm *vmm =3D dev->vram_mm; >> struct ttm_bo_device *bdev; >> int ret; >> @@ -199,8 +200,7 @@ struct drm_gem_vram_object *drm_gem_vram_create(st= ruct drm_device *dev, >> return ERR_PTR(-EINVAL); >> =20 >> if (dev->driver->gem_create_object) { >> - struct drm_gem_object *gem =3D >> - dev->driver->gem_create_object(dev, size); >> + gem =3D dev->driver->gem_create_object(dev, size); >> if (!gem) >> return ERR_PTR(-ENOMEM); >> gbo =3D drm_gem_vram_of_gem(gem); >> @@ -208,11 +208,13 @@ struct drm_gem_vram_object *drm_gem_vram_create(= struct drm_device *dev, >> gbo =3D kzalloc(sizeof(*gbo), GFP_KERNEL); >> if (!gbo) >> return ERR_PTR(-ENOMEM); >> + gem =3D &gbo->bo.base; >> } >> =20 >> - gbo->bo.base.funcs =3D &drm_gem_vram_object_funcs; >> + if (!gem->funcs) >> + gem->funcs =3D &drm_gem_vram_object_funcs; >> =20 >> - ret =3D drm_gem_object_init(dev, &gbo->bo.base, size); >> + ret =3D drm_gem_object_init(dev, gem, size); >> if (ret) { >> kfree(gbo); >> return ERR_PTR(ret); >> --=20 >> 2.27.0 >> >> _______________________________________________ >> dri-devel mailing list >> dri-devel@lists.freedesktop.org >> https://lists.freedesktop.org/mailman/listinfo/dri-devel > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel >=20 --=20 Thomas Zimmermann Graphics Driver Developer SUSE Software Solutions Germany GmbH Maxfeldstr. 5, 90409 N=C3=BCrnberg, Germany (HRB 36809, AG N=C3=BCrnberg) Gesch=C3=A4ftsf=C3=BChrer: Felix Imend=C3=B6rffer --aSshCli58I1CzR5W9AIKozTew3qQxg7nF-- --2tv3b3WAQeXTYgn3JJBGJg9j0IPNhNiFq Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQFIBAEBCAAyFiEEchf7rIzpz2NEoWjlaA3BHVMLeiMFAl8RRHsUHHR6aW1tZXJt YW5uQHN1c2UuZGUACgkQaA3BHVMLeiMSrAf/Ux3y6+Z66jFjh0Jk5mFltrDLjYOQ MLQT3biCUURJTytTzwDgMXfceQEjHmfDkCwMCKSUQu/9fyTPONMrwYES3d6LANt0 HW+NMUsqsMtdOSVeq5l8R4GKaMvSfOz1IjHfQzIEEThdLzfc8V2QMTm8x22a4p4Z Q0/Ma5qAzxlqEQbjxHCjmoyq20f7kaSV54eYi7uE/oDe1XG4ea5qoDnikSUtTLoB dr3vK2kGklmcra0BHV2qjiRkv0wsxSNomGQiqms4kX3VqvKY84Wb34GS0RE3MTJ3 9gOgk23n8PLYM2VhD7uBHY1X9WGsObT7kRWOXcnu1vJ653TDf1dVuefcXg== =B8eC -----END PGP SIGNATURE----- --2tv3b3WAQeXTYgn3JJBGJg9j0IPNhNiFq-- --===============0837391726== 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 https://lists.freedesktop.org/mailman/listinfo/dri-devel --===============0837391726==--