From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Rob Clark <robdclark@gmail.com>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Sharat Masetty <smasetty@codeaurora.org>,
Rob Clark <robdclark@chromium.org>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Douglas Anderson <dianders@chromium.org>,
Brian Masney <masneyb@onstation.org>,
Fabio Estevam <festevam@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] drm/msm: support firmware-name for zap fw
Date: Wed, 8 Jan 2020 11:04:48 -0800 [thread overview]
Message-ID: <20200108190448.GI1214176@minitux> (raw)
In-Reply-To: <20200108184850.GA13260@jcrouse1-lnx.qualcomm.com>
On Wed 08 Jan 10:48 PST 2020, Jordan Crouse wrote:
> On Tue, Jan 07, 2020 at 05:38:42PM -0800, Rob Clark wrote:
> > From: Rob Clark <robdclark@chromium.org>
> >
> > Since zap firmware can be device specific, allow for a firmware-name
> > property in the zap node to specify which firmware to load, similarly to
> > the scheme used for dsp/wifi/etc.
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > ---
> > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 32 ++++++++++++++++++++++---
> > 1 file changed, 29 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > index 112e8b8a261e..aa8737bd58db 100644
> > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > @@ -26,6 +26,7 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
> > {
> > struct device *dev = &gpu->pdev->dev;
> > const struct firmware *fw;
> > + const char *signed_fwname = NULL;
> > struct device_node *np, *mem_np;
> > struct resource r;
> > phys_addr_t mem_phys;
> > @@ -58,8 +59,33 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
> >
> > mem_phys = r.start;
> >
> > - /* Request the MDT file for the firmware */
> > - fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
> > + /*
> > + * Check for a firmware-name property. This is the new scheme
> > + * to handle firmware that may be signed with device specific
> > + * keys, allowing us to have a different zap fw path for different
> > + * devices.
> > + *
> > + * If the firmware-name property is found, we bypass the
> > + * adreno_request_fw() mechanism, because we don't need to handle
> > + * the /lib/firmware/qcom/* vs /lib/firmware/* case.
> > + *
> > + * If the firmware-name property is not found, for backwards
> > + * compatibility we fall back to the fwname from the gpulist
> > + * table.
> > + */
> > + of_property_read_string_index(np, "firmware-name", 0, &signed_fwname);
> > + if (signed_fwname) {
> > + fwname = signed_fwname;
> > + ret = request_firmware_direct(&fw, signed_fwname, gpu->dev->dev);
> > + if (ret) {
> > + DRM_DEV_ERROR(dev, "could not load signed zap firmware: %d\n", ret);
> > + fw = ERR_PTR(ret);
> > + }
> > + } else {
> > + /* Request the MDT file for the firmware */
> > + fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
> > + }
> > +
>
> Since DT seems to be the trend for target specific firmware names I think we
> should plan to quickly deprecate the legacy name and not require new targets to
> set it. If a zap node is going to be opt in then it isn't onerous to ask
> the developer to set the additional property for each target platform.
>
For the zap specifically I agree that it would be nice to require this
property, but for non-zap firmware it seems reasonable to continue with
the existing scheme.
Regards,
Bjorn
WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Rob Clark <robdclark@gmail.com>,
dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org,
freedreno@lists.freedesktop.org, linux-arm-msm@vger.kernel.org,
Sharat Masetty <smasetty@codeaurora.org>,
Rob Clark <robdclark@chromium.org>, Sean Paul <sean@poorly.run>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Douglas Anderson <dianders@chromium.org>,
Brian Masney <masneyb@onstation.org>,
Fabio Estevam <festevam@gmail.com>,
Thomas Gleixner <tglx@linutronix.de>,
open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/3] drm/msm: support firmware-name for zap fw
Date: Wed, 8 Jan 2020 11:04:48 -0800 [thread overview]
Message-ID: <20200108190448.GI1214176@minitux> (raw)
In-Reply-To: <20200108184850.GA13260@jcrouse1-lnx.qualcomm.com>
On Wed 08 Jan 10:48 PST 2020, Jordan Crouse wrote:
> On Tue, Jan 07, 2020 at 05:38:42PM -0800, Rob Clark wrote:
> > From: Rob Clark <robdclark@chromium.org>
> >
> > Since zap firmware can be device specific, allow for a firmware-name
> > property in the zap node to specify which firmware to load, similarly to
> > the scheme used for dsp/wifi/etc.
> >
> > Signed-off-by: Rob Clark <robdclark@chromium.org>
> > ---
> > drivers/gpu/drm/msm/adreno/adreno_gpu.c | 32 ++++++++++++++++++++++---
> > 1 file changed, 29 insertions(+), 3 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > index 112e8b8a261e..aa8737bd58db 100644
> > --- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > +++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
> > @@ -26,6 +26,7 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
> > {
> > struct device *dev = &gpu->pdev->dev;
> > const struct firmware *fw;
> > + const char *signed_fwname = NULL;
> > struct device_node *np, *mem_np;
> > struct resource r;
> > phys_addr_t mem_phys;
> > @@ -58,8 +59,33 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
> >
> > mem_phys = r.start;
> >
> > - /* Request the MDT file for the firmware */
> > - fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
> > + /*
> > + * Check for a firmware-name property. This is the new scheme
> > + * to handle firmware that may be signed with device specific
> > + * keys, allowing us to have a different zap fw path for different
> > + * devices.
> > + *
> > + * If the firmware-name property is found, we bypass the
> > + * adreno_request_fw() mechanism, because we don't need to handle
> > + * the /lib/firmware/qcom/* vs /lib/firmware/* case.
> > + *
> > + * If the firmware-name property is not found, for backwards
> > + * compatibility we fall back to the fwname from the gpulist
> > + * table.
> > + */
> > + of_property_read_string_index(np, "firmware-name", 0, &signed_fwname);
> > + if (signed_fwname) {
> > + fwname = signed_fwname;
> > + ret = request_firmware_direct(&fw, signed_fwname, gpu->dev->dev);
> > + if (ret) {
> > + DRM_DEV_ERROR(dev, "could not load signed zap firmware: %d\n", ret);
> > + fw = ERR_PTR(ret);
> > + }
> > + } else {
> > + /* Request the MDT file for the firmware */
> > + fw = adreno_request_fw(to_adreno_gpu(gpu), fwname);
> > + }
> > +
>
> Since DT seems to be the trend for target specific firmware names I think we
> should plan to quickly deprecate the legacy name and not require new targets to
> set it. If a zap node is going to be opt in then it isn't onerous to ask
> the developer to set the additional property for each target platform.
>
For the zap specifically I agree that it would be nice to require this
property, but for non-zap firmware it seems reasonable to continue with
the existing scheme.
Regards,
Bjorn
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2020-01-08 19:04 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-08 1:38 [PATCH 0/3] drm/msm: use firmware-name to find zap fw Rob Clark
2020-01-08 1:38 ` Rob Clark
2020-01-08 1:38 ` [PATCH 1/3] drm/msm: support firmware-name for " Rob Clark
2020-01-08 1:38 ` Rob Clark
2020-01-08 5:00 ` Bjorn Andersson
2020-01-08 5:00 ` Bjorn Andersson
2020-01-08 15:38 ` Tom Rix
2020-01-08 16:30 ` Rob Clark
2020-01-12 19:36 ` Rob Clark
2020-01-08 18:48 ` Jordan Crouse
2020-01-08 18:48 ` Jordan Crouse
2020-01-08 19:04 ` Bjorn Andersson [this message]
2020-01-08 19:04 ` Bjorn Andersson
2020-01-08 1:38 ` [PATCH 2/3] dt-bindings: drm/msm/gpu: Document firmware-name Rob Clark
2020-01-08 1:38 ` Rob Clark
2020-01-08 4:57 ` Bjorn Andersson
2020-01-08 4:57 ` Bjorn Andersson
2020-01-08 1:38 ` [PATCH 3/3] arm64: dts: sdm845: move gpu zap nodes to per-device dts Rob Clark
2020-01-08 1:38 ` Rob Clark
2020-01-08 4:57 ` Bjorn Andersson
2020-01-08 4:57 ` Bjorn Andersson
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=20200108190448.GI1214176@minitux \
--to=bjorn.andersson@linaro.org \
--cc=airlied@linux.ie \
--cc=daniel@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dianders@chromium.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=festevam@gmail.com \
--cc=freedreno@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=masneyb@onstation.org \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=smasetty@codeaurora.org \
--cc=tglx@linutronix.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.