<div dir="ltr"><div style="font-size:large;color:rgb(68,68,68)"><font face="arial, sans-serif">Hello members, </font></div><div style="font-size:large;color:rgb(68,68,68)"><font face="arial, sans-serif">I'm Forcha Pearl, a final-year Computer Science postgraduate. </font></div><div style="font-size:large;color:rgb(68,68,68)"><font face="arial, sans-serif">I'm good at Python, C++,C and JavaScript languages and have completed a few projects,<br>excited to explore open source by contributing and learning. <br><br></font></div><div style="font-size:large;color:rgb(68,68,68)"><font face="arial, sans-serif">Could anyone kindly assist me in making my initial contribution to <a href="http://X.ORG">X.ORG</a> foundation by suggesting beginner-friendly issues?</font></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Nov 7, 2023 at 12:49 AM <<a href="mailto:freedreno-request@lists.freedesktop.org">freedreno-request@lists.freedesktop.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Send Freedreno mailing list submissions to<br>
<a href="mailto:freedreno@lists.freedesktop.org" target="_blank">freedreno@lists.freedesktop.org</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
<a href="https://lists.freedesktop.org/mailman/listinfo/freedreno" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/freedreno</a><br>
or, via email, send a message with subject or body 'help' to<br>
<a href="mailto:freedreno-request@lists.freedesktop.org" target="_blank">freedreno-request@lists.freedesktop.org</a><br>
<br>
You can reach the person managing the list at<br>
<a href="mailto:freedreno-owner@lists.freedesktop.org" target="_blank">freedreno-owner@lists.freedesktop.org</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than "Re: Contents of Freedreno digest..."<br>
<br>
<br>
Today's Topics:<br>
<br>
1. [PATCH v3 2/2] drm/msm/gem: Add metadata (Rob Clark)<br>
2. Re: [PATCH] drm/msm/dpu: correct clk bit for WB2 block<br>
(Dmitry Baryshkov)<br>
3. Re: [PATCH] drm/msm/dpu: correct clk bit for WB2 block<br>
(Abhinav Kumar)<br>
4. Re: [PATCH] drm/msm/dpu: correct clk bit for WB2 block<br>
(Dmitry Baryshkov)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Mon, 6 Nov 2023 10:50:26 -0800<br>
From: Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>><br>
To: <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a><br>
Cc: <a href="mailto:freedreno@lists.freedesktop.org" target="_blank">freedreno@lists.freedesktop.org</a>, <a href="mailto:linux-arm-msm@vger.kernel.org" target="_blank">linux-arm-msm@vger.kernel.org</a>,<br>
Daniel Vetter <<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>>, Daniel Stone <<a href="mailto:daniels@collabora.com" target="_blank">daniels@collabora.com</a>>,<br>
Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>>, Rob Clark<br>
<<a href="mailto:robdclark@chromium.org" target="_blank">robdclark@chromium.org</a>>, Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>>, Abhinav<br>
Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>>, Sean Paul <sean@poorly.run>, Marijn<br>
Suijten <<a href="mailto:marijn.suijten@somainline.org" target="_blank">marijn.suijten@somainline.org</a>>, David Airlie<br>
<<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>>, <a href="mailto:linux-kernel@vger.kernel.org" target="_blank">linux-kernel@vger.kernel.org</a> (open list)<br>
Subject: [Freedreno] [PATCH v3 2/2] drm/msm/gem: Add metadata<br>
Message-ID: <<a href="mailto:20231106185028.209462-3-robdclark@gmail.com" target="_blank">20231106185028.209462-3-robdclark@gmail.com</a>><br>
<br>
From: Rob Clark <<a href="mailto:robdclark@chromium.org" target="_blank">robdclark@chromium.org</a>><br>
<br>
The EXT_external_objects extension is a bit awkward as it doesn't pass<br>
explicit modifiers, leaving the importer to guess with incomplete<br>
information. In the case of vk (turnip) exporting and gl (freedreno)<br>
importing, the "OPTIMAL_TILING_EXT" layout depends on VkImageCreateInfo<br>
flags (among other things), which the importer does not know. Which<br>
unfortunately leaves us with the need for a metadata back-channel.<br>
<br>
The contents of the metadata are defined by userspace. The<br>
EXT_external_objects extension is only required to work between<br>
compatible versions of gl and vk drivers, as defined by device and<br>
driver UUIDs.<br>
<br>
v2: add missing metadata kfree<br>
v3: Rework to move copy_from/to_user out from under gem obj lock<br>
to avoid angering lockdep about deadlocks against fs-reclaim<br>
<br>
Signed-off-by: Rob Clark <<a href="mailto:robdclark@chromium.org" target="_blank">robdclark@chromium.org</a>><br>
---<br>
Note, I dropped Dmitry's r-b on this version because it was a bit of<br>
a re-write of the original patch.<br>
<br>
drivers/gpu/drm/msm/msm_drv.c | 92 ++++++++++++++++++++++++++++++++++-<br>
drivers/gpu/drm/msm/msm_gem.c | 1 +<br>
drivers/gpu/drm/msm/msm_gem.h | 4 ++<br>
include/uapi/drm/msm_drm.h | 2 +<br>
4 files changed, 98 insertions(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/msm/msm_drv.c b/drivers/gpu/drm/msm/msm_drv.c<br>
index 781db689fb16..c05c27a70c34 100644<br>
--- a/drivers/gpu/drm/msm/msm_drv.c<br>
+++ b/drivers/gpu/drm/msm/msm_drv.c<br>
@@ -49,9 +49,10 @@<br>
* - 1.9.0 - Add MSM_SUBMIT_FENCE_SN_IN<br>
* - 1.10.0 - Add MSM_SUBMIT_BO_NO_IMPLICIT<br>
* - 1.11.0 - Add wait boost (MSM_WAIT_FENCE_BOOST, MSM_PREP_BOOST)<br>
+ * - 1.12.0 - Add MSM_INFO_SET_METADATA and MSM_INFO_GET_METADATA<br>
*/<br>
#define MSM_VERSION_MAJOR 1<br>
-#define MSM_VERSION_MINOR 11<br>
+#define MSM_VERSION_MINOR 12<br>
#define MSM_VERSION_PATCHLEVEL 0<br>
<br>
static void msm_deinit_vram(struct drm_device *ddev);<br>
@@ -822,6 +823,85 @@ static int msm_ioctl_gem_info_set_iova(struct drm_device *dev,<br>
return msm_gem_set_iova(obj, ctx->aspace, iova);<br>
}<br>
<br>
+static int msm_ioctl_gem_info_set_metadata(struct drm_gem_object *obj,<br>
+ __user void *metadata,<br>
+ u32 metadata_size)<br>
+{<br>
+ struct msm_gem_object *msm_obj = to_msm_bo(obj);<br>
+ void *buf;<br>
+ int ret;<br>
+<br>
+ /* Impose a moderate upper bound on metadata size: */<br>
+ if (metadata_size > 128) {<br>
+ return -EOVERFLOW;<br>
+ }<br>
+<br>
+ /* Use a temporary buf to keep copy_from_user() outside of gem obj lock: */<br>
+ buf = memdup_user(metadata, metadata_size);<br>
+ if (IS_ERR(buf))<br>
+ return PTR_ERR(buf);<br>
+<br>
+ ret = msm_gem_lock_interruptible(obj);<br>
+ if (ret)<br>
+ goto out;<br>
+<br>
+ msm_obj->metadata =<br>
+ krealloc(msm_obj->metadata, metadata_size, GFP_KERNEL);<br>
+ msm_obj->metadata_size = metadata_size;<br>
+ memcpy(msm_obj->metadata, buf, metadata_size);<br>
+<br>
+ msm_gem_unlock(obj);<br>
+<br>
+out:<br>
+ kfree(buf);<br>
+<br>
+ return ret;<br>
+}<br>
+<br>
+static int msm_ioctl_gem_info_get_metadata(struct drm_gem_object *obj,<br>
+ __user void *metadata,<br>
+ u32 *metadata_size)<br>
+{<br>
+ struct msm_gem_object *msm_obj = to_msm_bo(obj);<br>
+ void *buf;<br>
+ int ret, len;<br>
+<br>
+ if (!metadata) {<br>
+ /*<br>
+ * Querying the size is inherently racey, but<br>
+ * EXT_external_objects expects the app to confirm<br>
+ * via device and driver UUIDs that the exporter and<br>
+ * importer versions match. All we can do from the<br>
+ * kernel side is check the length under obj lock<br>
+ * when userspace tries to retrieve the metadata<br>
+ */<br>
+ *metadata_size = msm_obj->metadata_size;<br>
+ return 0;<br>
+ }<br>
+<br>
+ ret = msm_gem_lock_interruptible(obj);<br>
+ if (ret)<br>
+ return ret;<br>
+<br>
+ /* Avoid copy_to_user() under gem obj lock: */<br>
+ len = msm_obj->metadata_size;<br>
+ buf = kmemdup(msm_obj->metadata, len, GFP_KERNEL);<br>
+<br>
+ msm_gem_unlock(obj);<br>
+<br>
+ if (*metadata_size < len) {<br>
+ ret = -ETOOSMALL;<br>
+ } else if (copy_to_user(metadata, buf, len)) {<br>
+ ret = -EFAULT;<br>
+ } else {<br>
+ *metadata_size = len;<br>
+ }<br>
+<br>
+ kfree(buf);<br>
+<br>
+ return 0;<br>
+}<br>
+<br>
static int msm_ioctl_gem_info(struct drm_device *dev, void *data,<br>
struct drm_file *file)<br>
{<br>
@@ -844,6 +924,8 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data,<br>
break;<br>
case MSM_INFO_SET_NAME:<br>
case MSM_INFO_GET_NAME:<br>
+ case MSM_INFO_SET_METADATA:<br>
+ case MSM_INFO_GET_METADATA:<br>
break;<br>
default:<br>
return -EINVAL;<br>
@@ -906,6 +988,14 @@ static int msm_ioctl_gem_info(struct drm_device *dev, void *data,<br>
ret = -EFAULT;<br>
}<br>
break;<br>
+ case MSM_INFO_SET_METADATA:<br>
+ ret = msm_ioctl_gem_info_set_metadata(<br>
+ obj, u64_to_user_ptr(args->value), args->len);<br>
+ break;<br>
+ case MSM_INFO_GET_METADATA:<br>
+ ret = msm_ioctl_gem_info_get_metadata(<br>
+ obj, u64_to_user_ptr(args->value), &args->len);<br>
+ break;<br>
}<br>
<br>
drm_gem_object_put(obj);<br>
diff --git a/drivers/gpu/drm/msm/msm_gem.c b/drivers/gpu/drm/msm/msm_gem.c<br>
index 1113e6b2ec8e..175ee4ab8a6f 100644<br>
--- a/drivers/gpu/drm/msm/msm_gem.c<br>
+++ b/drivers/gpu/drm/msm/msm_gem.c<br>
@@ -1058,6 +1058,7 @@ static void msm_gem_free_object(struct drm_gem_object *obj)<br>
<br>
drm_gem_object_release(obj);<br>
<br>
+ kfree(msm_obj->metadata);<br>
kfree(msm_obj);<br>
}<br>
<br>
diff --git a/drivers/gpu/drm/msm/msm_gem.h b/drivers/gpu/drm/msm/msm_gem.h<br>
index 7f34263048a3..8d414b072c29 100644<br>
--- a/drivers/gpu/drm/msm/msm_gem.h<br>
+++ b/drivers/gpu/drm/msm/msm_gem.h<br>
@@ -109,6 +109,10 @@ struct msm_gem_object {<br>
<br>
char name[32]; /* Identifier to print for the debugfs files */<br>
<br>
+ /* userspace metadata backchannel */<br>
+ void *metadata;<br>
+ u32 metadata_size;<br>
+<br>
/**<br>
* pin_count: Number of times the pages are pinned<br>
*<br>
diff --git a/include/uapi/drm/msm_drm.h b/include/uapi/drm/msm_drm.h<br>
index 6c34272a13fd..6f2a7ad04aa4 100644<br>
--- a/include/uapi/drm/msm_drm.h<br>
+++ b/include/uapi/drm/msm_drm.h<br>
@@ -139,6 +139,8 @@ struct drm_msm_gem_new {<br>
#define MSM_INFO_GET_NAME 0x03 /* get debug name, returned by pointer */<br>
#define MSM_INFO_SET_IOVA 0x04 /* set the iova, passed by value */<br>
#define MSM_INFO_GET_FLAGS 0x05 /* get the MSM_BO_x flags */<br>
+#define MSM_INFO_SET_METADATA 0x06 /* set userspace metadata */<br>
+#define MSM_INFO_GET_METADATA 0x07 /* get userspace metadata */<br>
<br>
struct drm_msm_gem_info {<br>
__u32 handle; /* in */<br>
-- <br>
2.41.0<br>
<br>
<br>
<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 7 Nov 2023 00:11:47 +0200<br>
From: Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>><br>
To: Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>><br>
Cc: Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>>, Sean Paul <sean@poorly.run>,<br>
Marijn Suijten <<a href="mailto:marijn.suijten@somainline.org" target="_blank">marijn.suijten@somainline.org</a>>, Stephen Boyd<br>
<<a href="mailto:swboyd@chromium.org" target="_blank">swboyd@chromium.org</a>>, David Airlie <<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>>, Daniel<br>
Vetter <<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>>, Bjorn Andersson <<a href="mailto:andersson@kernel.org" target="_blank">andersson@kernel.org</a>>,<br>
<a href="mailto:linux-arm-msm@vger.kernel.org" target="_blank">linux-arm-msm@vger.kernel.org</a>, <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a>,<br>
<a href="mailto:freedreno@lists.freedesktop.org" target="_blank">freedreno@lists.freedesktop.org</a><br>
Subject: Re: [Freedreno] [PATCH] drm/msm/dpu: correct clk bit for WB2<br>
block<br>
Message-ID:<br>
<CAA8EJprpBy6UhtScRkFS24TgKevBOb9nVBFCqPhEof=-<a href="mailto:k58Mwg@mail.gmail.com" target="_blank">k58Mwg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="UTF-8"<br>
<br>
On Mon, 6 Nov 2023 at 20:39, Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>> wrote:<br>
><br>
> Sorry for the delay in getting back on this. There was quite a bit of<br>
> history digging I had to do myself to give a certain response.<br>
><br>
><br>
> On 10/9/2023 10:11 AM, Dmitry Baryshkov wrote:<br>
> > On sc7280 there are two clk bits for WB2: control and status. While<br>
> > programming the VBIF params of WB, the driver should be toggling the<br>
> > former bit, while the sc7280_mdp struct lists the latter one.<br>
> ><br>
><br>
> No, this is not correct. Both are control bits. But for the context of<br>
> where this is being used today, that is setting the VBIF OT limit, we<br>
> should be using the VBIF_CLI one. So the below change itself is correct<br>
> but not the commit text.<br>
<br>
Maybe you can update dt bindings for the SDE driver? Because they<br>
clearly speak about the control and status bits.<br>
<br>
><br>
> We need to make the same change on sm8250 WB2 as well as this register<br>
> is present there too. In fact, anything >=msm8994 for setting VBIF OT<br>
> for WB2 we should be using VBIF_CLI bits of register MDP_CLK_CTRL2<br>
> (offset 0x2bc).<br>
><br>
> For anything >=sm8550, we need to use WB_2_CLK_CTRL present within the<br>
> WB block and not the one in the top.<br>
><br>
> Hence for this change, we can do below:<br>
><br>
> -> update the commit text to indicate both are control bits but for the<br>
> vbif ot context we should using the corrected one<br>
> -> if you can also add sm8250 in the same change i can ack it and pick it up<br>
><br>
> Have you re-validated WB with this change? If not, let me know I shall<br>
> while picking this up for -fixes.<br>
<br>
No, I haven't validated this on sc7280. I'll try this on sm8250 and<br>
then I'll send v2.<br>
<br>
><br>
> > Correct that to ensure proper programming sequence for WB2 on sc7280.<br>
> ><br>
> > Fixes: 3ce166380567 ("drm/msm/dpu: add writeback support for sc7280")<br>
> > Signed-off-by: Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>><br>
> > ---<br>
> > drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 2 +-<br>
> > 1 file changed, 1 insertion(+), 1 deletion(-)<br>
> ><br>
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
> > index 3b5061c4402a..9195cb996f44 100644<br>
> > --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
> > @@ -25,7 +25,7 @@ static const struct dpu_mdp_cfg sc7280_mdp = {<br>
> > [DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },<br>
> > [DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },<br>
> > [DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },<br>
> > - [DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },<br>
> > + [DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },<br>
> > },<br>
> > };<br>
> ><br>
<br>
<br>
<br>
-- <br>
With best wishes<br>
Dmitry<br>
<br>
<br>
------------------------------<br>
<br>
Message: 3<br>
Date: Mon, 6 Nov 2023 15:30:32 -0800<br>
From: Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>><br>
To: Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>><br>
Cc: Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>>, Sean Paul <sean@poorly.run>,<br>
Marijn Suijten <<a href="mailto:marijn.suijten@somainline.org" target="_blank">marijn.suijten@somainline.org</a>>, Stephen Boyd<br>
<<a href="mailto:swboyd@chromium.org" target="_blank">swboyd@chromium.org</a>>, David Airlie <<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>>, Daniel Vetter<br>
<<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>>, Bjorn Andersson <<a href="mailto:andersson@kernel.org" target="_blank">andersson@kernel.org</a>>,<br>
<<a href="mailto:linux-arm-msm@vger.kernel.org" target="_blank">linux-arm-msm@vger.kernel.org</a>>, <<a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a>>,<br>
<<a href="mailto:freedreno@lists.freedesktop.org" target="_blank">freedreno@lists.freedesktop.org</a>><br>
Subject: Re: [Freedreno] [PATCH] drm/msm/dpu: correct clk bit for WB2<br>
block<br>
Message-ID: <<a href="mailto:1ac30bfd-86d9-8186-1aee-f201b8ff4370@quicinc.com" target="_blank">1ac30bfd-86d9-8186-1aee-f201b8ff4370@quicinc.com</a>><br>
Content-Type: text/plain; charset="UTF-8"; format=flowed<br>
<br>
<br>
<br>
On 11/6/2023 2:11 PM, Dmitry Baryshkov wrote:<br>
> On Mon, 6 Nov 2023 at 20:39, Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>> wrote:<br>
>><br>
>> Sorry for the delay in getting back on this. There was quite a bit of<br>
>> history digging I had to do myself to give a certain response.<br>
>><br>
>><br>
>> On 10/9/2023 10:11 AM, Dmitry Baryshkov wrote:<br>
>>> On sc7280 there are two clk bits for WB2: control and status. While<br>
>>> programming the VBIF params of WB, the driver should be toggling the<br>
>>> former bit, while the sc7280_mdp struct lists the latter one.<br>
>>><br>
>><br>
>> No, this is not correct. Both are control bits. But for the context of<br>
>> where this is being used today, that is setting the VBIF OT limit, we<br>
>> should be using the VBIF_CLI one. So the below change itself is correct<br>
>> but not the commit text.<br>
> <br>
> Maybe you can update dt bindings for the SDE driver? Because they<br>
> clearly speak about the control and status bits.<br>
> <br>
<br>
There is nothing to update here if we both are referring to the same <br>
entries in the dt bindings.<br>
<br>
qcom,sde-wb-clk-status = <0x3bc 20>;<br>
<br>
the clk status is indeed bit 20 of 0x3bc.<br>
<br>
What we have before your patch was bit 24 of 0x3b8 which was indeed <br>
clk_ctl bit for wb2. But the only issue was it was not the vbif_cli one.<br>
<br>
So we are talking about two different registers?<br>
<br>
>><br>
>> We need to make the same change on sm8250 WB2 as well as this register<br>
>> is present there too. In fact, anything >=msm8994 for setting VBIF OT<br>
>> for WB2 we should be using VBIF_CLI bits of register MDP_CLK_CTRL2<br>
>> (offset 0x2bc).<br>
>><br>
>> For anything >=sm8550, we need to use WB_2_CLK_CTRL present within the<br>
>> WB block and not the one in the top.<br>
>><br>
>> Hence for this change, we can do below:<br>
>><br>
>> -> update the commit text to indicate both are control bits but for the<br>
>> vbif ot context we should using the corrected one<br>
>> -> if you can also add sm8250 in the same change i can ack it and pick it up<br>
>><br>
>> Have you re-validated WB with this change? If not, let me know I shall<br>
>> while picking this up for -fixes.<br>
> <br>
> No, I haven't validated this on sc7280. I'll try this on sm8250 and<br>
> then I'll send v2.<br>
> <br>
>><br>
>>> Correct that to ensure proper programming sequence for WB2 on sc7280.<br>
>>><br>
>>> Fixes: 3ce166380567 ("drm/msm/dpu: add writeback support for sc7280")<br>
>>> Signed-off-by: Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>><br>
>>> ---<br>
>>> drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 2 +-<br>
>>> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
>>><br>
>>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
>>> index 3b5061c4402a..9195cb996f44 100644<br>
>>> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
>>> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
>>> @@ -25,7 +25,7 @@ static const struct dpu_mdp_cfg sc7280_mdp = {<br>
>>> [DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },<br>
>>> [DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },<br>
>>> [DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },<br>
>>> - [DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },<br>
>>> + [DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },<br>
>>> },<br>
>>> };<br>
>>><br>
> <br>
> <br>
> <br>
<br>
<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Tue, 7 Nov 2023 01:49:03 +0200<br>
From: Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>><br>
To: Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>><br>
Cc: Rob Clark <<a href="mailto:robdclark@gmail.com" target="_blank">robdclark@gmail.com</a>>, Sean Paul <sean@poorly.run>,<br>
Marijn Suijten <<a href="mailto:marijn.suijten@somainline.org" target="_blank">marijn.suijten@somainline.org</a>>, Stephen Boyd<br>
<<a href="mailto:swboyd@chromium.org" target="_blank">swboyd@chromium.org</a>>, David Airlie <<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>>, Daniel<br>
Vetter <<a href="mailto:daniel@ffwll.ch" target="_blank">daniel@ffwll.ch</a>>, Bjorn Andersson <<a href="mailto:andersson@kernel.org" target="_blank">andersson@kernel.org</a>>,<br>
<a href="mailto:linux-arm-msm@vger.kernel.org" target="_blank">linux-arm-msm@vger.kernel.org</a>, <a href="mailto:dri-devel@lists.freedesktop.org" target="_blank">dri-devel@lists.freedesktop.org</a>,<br>
<a href="mailto:freedreno@lists.freedesktop.org" target="_blank">freedreno@lists.freedesktop.org</a><br>
Subject: Re: [Freedreno] [PATCH] drm/msm/dpu: correct clk bit for WB2<br>
block<br>
Message-ID:<br>
<<a href="mailto:CAA8EJppY0V20rF1kV-b8X2xuCQ6ZHy_%2B0YGp5s6b_Srvq-LLNg@mail.gmail.com" target="_blank">CAA8EJppY0V20rF1kV-b8X2xuCQ6ZHy_+0YGp5s6b_Srvq-LLNg@mail.gmail.com</a>><br>
Content-Type: text/plain; charset="UTF-8"<br>
<br>
On Tue, 7 Nov 2023 at 01:30, Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>> wrote:<br>
><br>
><br>
><br>
> On 11/6/2023 2:11 PM, Dmitry Baryshkov wrote:<br>
> > On Mon, 6 Nov 2023 at 20:39, Abhinav Kumar <<a href="mailto:quic_abhinavk@quicinc.com" target="_blank">quic_abhinavk@quicinc.com</a>> wrote:<br>
> >><br>
> >> Sorry for the delay in getting back on this. There was quite a bit of<br>
> >> history digging I had to do myself to give a certain response.<br>
> >><br>
> >><br>
> >> On 10/9/2023 10:11 AM, Dmitry Baryshkov wrote:<br>
> >>> On sc7280 there are two clk bits for WB2: control and status. While<br>
> >>> programming the VBIF params of WB, the driver should be toggling the<br>
> >>> former bit, while the sc7280_mdp struct lists the latter one.<br>
> >>><br>
> >><br>
> >> No, this is not correct. Both are control bits. But for the context of<br>
> >> where this is being used today, that is setting the VBIF OT limit, we<br>
> >> should be using the VBIF_CLI one. So the below change itself is correct<br>
> >> but not the commit text.<br>
> ><br>
> > Maybe you can update dt bindings for the SDE driver? Because they<br>
> > clearly speak about the control and status bits.<br>
> ><br>
><br>
> There is nothing to update here if we both are referring to the same<br>
> entries in the dt bindings.<br>
><br>
> qcom,sde-wb-clk-status = <0x3bc 20>;<br>
><br>
> the clk status is indeed bit 20 of 0x3bc.<br>
><br>
> What we have before your patch was bit 24 of 0x3b8 which was indeed<br>
> clk_ctl bit for wb2. But the only issue was it was not the vbif_cli one.<br>
><br>
> So we are talking about two different registers?<br>
<br>
Ah, excuse me then, I didn't notice 24 vs 20.<br>
<br>
><br>
> >><br>
> >> We need to make the same change on sm8250 WB2 as well as this register<br>
> >> is present there too. In fact, anything >=msm8994 for setting VBIF OT<br>
> >> for WB2 we should be using VBIF_CLI bits of register MDP_CLK_CTRL2<br>
> >> (offset 0x2bc).<br>
> >><br>
> >> For anything >=sm8550, we need to use WB_2_CLK_CTRL present within the<br>
> >> WB block and not the one in the top.<br>
> >><br>
> >> Hence for this change, we can do below:<br>
> >><br>
> >> -> update the commit text to indicate both are control bits but for the<br>
> >> vbif ot context we should using the corrected one<br>
> >> -> if you can also add sm8250 in the same change i can ack it and pick it up<br>
> >><br>
> >> Have you re-validated WB with this change? If not, let me know I shall<br>
> >> while picking this up for -fixes.<br>
> ><br>
> > No, I haven't validated this on sc7280. I'll try this on sm8250 and<br>
> > then I'll send v2.<br>
> ><br>
> >><br>
> >>> Correct that to ensure proper programming sequence for WB2 on sc7280.<br>
> >>><br>
> >>> Fixes: 3ce166380567 ("drm/msm/dpu: add writeback support for sc7280")<br>
> >>> Signed-off-by: Dmitry Baryshkov <<a href="mailto:dmitry.baryshkov@linaro.org" target="_blank">dmitry.baryshkov@linaro.org</a>><br>
> >>> ---<br>
> >>> drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h | 2 +-<br>
> >>> 1 file changed, 1 insertion(+), 1 deletion(-)<br>
> >>><br>
> >>> diff --git a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
> >>> index 3b5061c4402a..9195cb996f44 100644<br>
> >>> --- a/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
> >>> +++ b/drivers/gpu/drm/msm/disp/dpu1/catalog/dpu_7_2_sc7280.h<br>
> >>> @@ -25,7 +25,7 @@ static const struct dpu_mdp_cfg sc7280_mdp = {<br>
> >>> [DPU_CLK_CTRL_DMA0] = { .reg_off = 0x2ac, .bit_off = 8 },<br>
> >>> [DPU_CLK_CTRL_DMA1] = { .reg_off = 0x2b4, .bit_off = 8 },<br>
> >>> [DPU_CLK_CTRL_DMA2] = { .reg_off = 0x2c4, .bit_off = 8 },<br>
> >>> - [DPU_CLK_CTRL_WB2] = { .reg_off = 0x3b8, .bit_off = 24 },<br>
> >>> + [DPU_CLK_CTRL_WB2] = { .reg_off = 0x2bc, .bit_off = 16 },<br>
> >>> },<br>
> >>> };<br>
> >>><br>
> ><br>
> ><br>
> ><br>
<br>
<br>
<br>
-- <br>
With best wishes<br>
Dmitry<br>
<br>
<br>
------------------------------<br>
<br>
Subject: Digest Footer<br>
<br>
_______________________________________________<br>
Freedreno mailing list<br>
<a href="mailto:Freedreno@lists.freedesktop.org" target="_blank">Freedreno@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/freedreno" rel="noreferrer" target="_blank">https://lists.freedesktop.org/mailman/listinfo/freedreno</a><br>
<br>
<br>
------------------------------<br>
<br>
End of Freedreno Digest, Vol 117, Issue 10<br>
******************************************<br>
</blockquote></div>