From: Frank Binns <Frank.Binns@imgtec.com>
To: "mripard@redhat.com" <mripard@redhat.com>,
Sarah Walker <Sarah.Walker@imgtec.com>
Cc: "matthew.brost@intel.com" <matthew.brost@intel.com>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>,
"christian.koenig@amd.com" <christian.koenig@amd.com>,
"luben.tuikov@amd.com" <luben.tuikov@amd.com>,
"dakr@redhat.com" <dakr@redhat.com>,
Donald Robson <Donald.Robson@imgtec.com>,
"boris.brezillon@collabora.com" <boris.brezillon@collabora.com>,
"sumit.semwal@linaro.org" <sumit.semwal@linaro.org>,
"faith.ekstrand@collabora.com" <faith.ekstrand@collabora.com>
Subject: Re: [PATCH v3 04/17] drm/imagination: Add skeleton PowerVR driver
Date: Fri, 14 Jul 2023 13:15:21 +0000 [thread overview]
Message-ID: <b3d7328895e6d3afa2d194669a88fd3d275f3003.camel@imgtec.com> (raw)
In-Reply-To: <qt5b3tuxfcrup7roh2hiwhqzofj7kde3fc43vdblte6dbomupy@lsf7drxz7tx5>
Hi Maxime,
Thank you for your feedback (comments below).
On Fri, 2023-07-07 at 14:46 +0200, Maxime Ripard wrote:
> Hi,
>
> [I just noticed I dropped the Cc list, resending]
>
> Thanks for contributing this driver, it's awesome to see it moving
> forward.
>
> And congrats on the documentation too, it's not often we see a driver
> that well documented on its v3.
>
> I've stripped some parts of the patch that weren't relevant to my
> review.
>
> On Tue, Jun 13, 2023 at 03:47:47PM +0100, Sarah Walker wrote:
> > +static __always_inline struct pvr_device *
> > +to_pvr_device(struct drm_device *drm_dev)
> > +{
> > + return container_of(drm_dev, struct pvr_device, base);
> > +}
>
> For that kind of helpers, we're slowly transitioning to using a macro
> and container_of_const. This allows to work with const-ness context.
Ack
>
> > +static int
> > +pvr_probe(struct platform_device *plat_dev)
> > +{
> > + struct pvr_device *pvr_dev;
> > + struct drm_device *drm_dev;
> > + int err;
> > +
> > + pvr_dev = devm_drm_dev_alloc(&plat_dev->dev, &pvr_drm_driver,
> > + struct pvr_device, base);
> > + if (IS_ERR(pvr_dev)) {
> > + err = IS_ERR(pvr_dev);
>
> PTR_ERR?
Good catch :)
>
> > + goto err_out;
>
> The general pattern here is to return directly here, it's simpler to
> follow.
Ack
>
> > + }
> > + drm_dev = &pvr_dev->base;
> > +
> > + platform_set_drvdata(plat_dev, drm_dev);
> > +
> > + err = drm_dev_register(drm_dev, 0);
> > + if (err)
> > + goto err_out;
>
> I guess it would be simpler here too, but I think you're going to move
> things around anyway?
>
> > +static const struct of_device_id dt_match[] = {
> > + { .compatible = "ti,am62-gpu", .data = NULL },
> > + { .compatible = "img,powervr-seriesaxe", .data = NULL },
>
> Do you really need both? The binding you documented requires both to be
> there, so I think you can either match on the more specific one (and
> extend that list when needed) or match the more generic one and be done
> with it once and for all. Having both is redundant.
We'll drop the more specific one in the next version.
>
> > + {}
> > +};
> > +MODULE_DEVICE_TABLE(of, dt_match);
> > +
> > +static struct platform_driver pvr_driver = {
> > + .probe = pvr_probe,
> > + .remove = pvr_remove,
> > + .driver = {
> > + .name = PVR_DRIVER_NAME,
> > + .of_match_table = dt_match,
> > + },
> > +};
> > +module_platform_driver(pvr_driver);
> > +
> > +MODULE_AUTHOR("Imagination Technologies Ltd.");
> > +MODULE_DESCRIPTION(PVR_DRIVER_DESC);
> > +MODULE_LICENSE("Dual MIT/GPL");
> > +MODULE_IMPORT_NS(DMA_BUF);
> > +MODULE_FIRMWARE("powervr/rogue_4.40.2.51_v1.fw");
> > +MODULE_FIRMWARE("powervr/rogue_33.15.11.3_v1.fw");
>
> That one should probably be moved to the firmware patch?
Ack
>
> > diff --git a/drivers/gpu/drm/imagination/pvr_drv.h b/drivers/gpu/drm/imagination/pvr_drv.h
> > new file mode 100644
> > index 000000000000..8e6f4a4dde3f
> > --- /dev/null
> > +++ b/drivers/gpu/drm/imagination/pvr_drv.h
> > @@ -0,0 +1,22 @@
> > +/* SPDX-License-Identifier: GPL-2.0 OR MIT */
> > +/* Copyright (c) 2022 Imagination Technologies Ltd. */
> > +
> > +#ifndef PVR_DRV_H
> > +#define PVR_DRV_H
> > +
> > +#include "linux/compiler_attributes.h"
> > +#include <uapi/drm/pvr_drm.h>
> > +
> > +#define PVR_DRIVER_NAME "powervr"
> > +#define PVR_DRIVER_DESC "Imagination PowerVR Graphics"
>
> Do you intend to support the SGX and Rogue GPUs with this driver? If
> not, mentioning the generation/architecture name somewhere would be
> nice.
We don't currently have any plans to support SGX ourselves, so we'll update
this, and any other places, to clarify things.
Thanks
Frank
>
> Maxime
next prev parent reply other threads:[~2023-07-14 13:15 UTC|newest]
Thread overview: 50+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-13 14:47 [PATCH v3 00/17] Imagination Technologies PowerVR DRM driver Sarah Walker
2023-06-13 14:47 ` [PATCH v3 01/17] sizes.h: Add entries between 32G and 64T Sarah Walker
2023-06-16 12:10 ` Linus Walleij
2023-06-26 13:25 ` Frank Binns
2023-06-13 14:47 ` [PATCH v3 02/17] dt-bindings: gpu: Add Imagination Technologies PowerVR GPU Sarah Walker
2023-06-13 17:38 ` Andrew Davis
2023-06-16 11:23 ` Frank Binns
2023-06-13 18:24 ` Krzysztof Kozlowski
2023-06-14 14:34 ` Frank Binns
2023-06-15 20:50 ` Rob Herring
2023-06-16 11:27 ` Frank Binns
2023-06-16 12:48 ` Linus Walleij
2023-06-16 14:23 ` Rob Herring
2023-07-04 15:13 ` Frank Binns
2023-07-05 7:08 ` Linus Walleij
2023-06-13 14:47 ` [PATCH v3 03/17] drm/imagination/uapi: Add PowerVR driver UAPI Sarah Walker
2023-06-13 14:47 ` [PATCH v3 04/17] drm/imagination: Add skeleton PowerVR driver Sarah Walker
2023-07-07 12:46 ` Maxime Ripard
2023-07-14 13:15 ` Frank Binns [this message]
2023-06-13 14:47 ` [PATCH v3 05/17] drm/imagination: Get GPU resources Sarah Walker
2023-06-13 18:12 ` Andrew Davis
2023-06-16 11:23 ` Frank Binns
2023-07-07 12:47 ` Maxime Ripard
2023-07-14 13:39 ` Frank Binns
2023-06-13 14:47 ` [PATCH v3 06/17] drm/imagination: Add GPU register and FWIF headers Sarah Walker
2023-06-13 14:47 ` [PATCH v3 07/17] drm/imagination: Add GPU ID parsing and firmware loading Sarah Walker
2023-06-17 12:48 ` Adam Ford
2023-06-26 13:22 ` Frank Binns
2023-06-26 15:38 ` Adam Ford
2023-07-05 13:13 ` Frank Binns
2023-07-05 18:10 ` Marek Vasut
2023-06-13 14:47 ` [PATCH v3 08/17] drm/imagination: Add GEM and VM related code Sarah Walker
2023-06-13 14:47 ` [PATCH v3 09/17] drm/imagination: Implement power management Sarah Walker
2023-07-07 12:48 ` Maxime Ripard
2023-07-14 13:47 ` Frank Binns
2023-06-13 14:47 ` [PATCH v3 10/17] drm/imagination: Implement firmware infrastructure and META FW support Sarah Walker
2023-06-13 14:47 ` [PATCH v3 11/17] drm/imagination: Implement MIPS firmware processor and MMU support Sarah Walker
2023-06-13 14:47 ` [PATCH v3 12/17] drm/imagination: Implement free list and HWRT create and destroy ioctls Sarah Walker
2023-06-13 14:47 ` [PATCH v3 13/17] drm/imagination: Implement context creation/destruction ioctls Sarah Walker
2023-06-13 14:47 ` [PATCH v3 14/17] drm/imagination: Implement job submission and scheduling Sarah Walker
2023-06-13 14:47 ` [PATCH v3 15/17] drm/imagination: Add firmware trace to debugfs Sarah Walker
2023-06-13 14:47 ` [PATCH v3 16/17] drm/imagination: Add driver documentation Sarah Walker
2023-06-13 14:48 ` [PATCH v3 17/17] arm64: dts: ti: k3-am62-main: Add GPU device node [DO NOT MERGE] Sarah Walker
2023-06-13 18:26 ` [PATCH v3 00/17] Imagination Technologies PowerVR DRM driver Krzysztof Kozlowski
2023-06-16 12:29 ` Linus Walleij
2023-06-16 14:06 ` H. Nikolaus Schaller
2023-06-26 13:45 ` Frank Binns
2023-06-26 18:48 ` H. Nikolaus Schaller
2023-06-16 14:08 ` H. Nikolaus Schaller
2023-06-26 13:31 ` Frank Binns
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b3d7328895e6d3afa2d194669a88fd3d275f3003.camel@imgtec.com \
--to=frank.binns@imgtec.com \
--cc=Donald.Robson@imgtec.com \
--cc=Sarah.Walker@imgtec.com \
--cc=boris.brezillon@collabora.com \
--cc=christian.koenig@amd.com \
--cc=dakr@redhat.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=faith.ekstrand@collabora.com \
--cc=luben.tuikov@amd.com \
--cc=matthew.brost@intel.com \
--cc=mripard@redhat.com \
--cc=sumit.semwal@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).