From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Marijn Suijten <marijn.suijten@somainline.org>,
Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: freedreno@lists.freedesktop.org,
kernel test robot <lkp@intel.com>,
David Airlie <airlied@linux.ie>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
Stephen Boyd <swboyd@chromium.org>,
Rob Clark <robdclark@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Sean Paul <sean@poorly.run>
Subject: Re: [Freedreno] [PATCH v2] drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing
Date: Mon, 2 May 2022 13:02:09 +0300 [thread overview]
Message-ID: <f8986d6d-2c2b-a0a0-d63c-d4670f6864ff@linaro.org> (raw)
In-Reply-To: <20220502083442.t365cfmivlga557g@SoMainline.org>
On 02/05/2022 11:34, Marijn Suijten wrote:
> On 2022-05-01 16:56:45, Abhinav Kumar wrote:
>> [snip]
>> Wouln't this macro already make sure that 'reg' doesnt have anything in
>> the top 16 bits? Its doing a & with 0x00003f00
>
> Like I said, it is unlikely that this happens, only if someone starts
> changing the code that assigns to `reg` which is unlikely to pass review
> anyway.
>
>> [snip]
>> We can have a common bitfield layout for the two channels for command mode.
>>
>> So we can do something like below for common fields:
>>
>> -static inline uint32_t
>> DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE(uint32_t val)
>> +static inline uint32_t
>> DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM_DATATYPE(uint32_t val, uint32_t
>> stream_id)
>> {
>> - return ((val) <<
>> DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE__SHIFT) &
>> DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE__MASK;
>> + return ((val) <<
>> (DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE__SHIFT + (stream_id
>> * 16)) & DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE__MASK;
>> }
>>
>> Video mode can also use all of these except for WC as that field is not
>> present for cmd modes.
>>
>> This can go as a separate change .
>>
>> I can push this and perhaps get a Tested-by from Vinod as I dont have a
>> setup to re-validate this.
>
> How would you represent this in XML? I was hoping for a method that
> allows to construct the value in a generic way, without register names,
> and then simply have a "register macro" that moves (and perhaps masks)
> the preconstructed value into the right place. A bit like how `enum`s
> are currently set up in XML, but with bit ranges for the values and
> macros to set a value.
>
> I think I've _partially_ found what I was looking for: a `<bitset>`.
> However, I don't know if we can utilize this multiple times within a
> single `reg32`, once with an offset for stream1. Alas, it's just
> bikeshedding at this point.
Unfortunately the following naïve patch doesn't work, stream1 bits are
still defined in the 0:15 bit space. One would have to modify rnn tool
to make sure that it takes into account the low/high parts of the
bitfield when generating offsets/masks.
diff --git a/src/freedreno/registers/dsi/dsi.xml
b/src/freedreno/registers/dsi/dsi.xml
index f2eef4ff41ae..b0166628ad0a 100644
--- a/src/freedreno/registers/dsi/dsi.xml
+++ b/src/freedreno/registers/dsi/dsi.xml
@@ -361,22 +361,19 @@
xsi:schemaLocation="http://nouveau.freedesktop.org/ rules-ng.xsd">
<bitfield name="MAJOR" low="24" high="31" type="uint"/>
</reg32>
<reg32 offset="0x002d4" name="CPHY_MODE_CTRL"/>
- <reg32 offset="0x0029c" name="VIDEO_COMPRESSION_MODE_CTRL">
- <bitfield name="WC" low="16" high="31" type="uint"/>
+ <bitset name="COMPRESSION_MODE_CTRL" inline="true">
<bitfield name="DATATYPE" low="8" high="13" type="uint"/>
<bitfield name="PKT_PER_LINE" low="6" high="7"
type="uint"/>
<bitfield name="EOL_BYTE_NUM" low="4" high="5"
type="uint"/>
<bitfield name="EN" pos="0" type="boolean"/>
+ </bitset>
+ <reg32 offset="0x0029c" name="VIDEO_COMPRESSION_MODE_CTRL">
+ <bitfield name="WC" low="16" high="31" type="uint"/>
+ <bitfield name="STREAM0" low="0" high="15"
type="COMPRESSION_MODE_CTRL"/>
</reg32>
<reg32 offset="0x002a4" name="COMMAND_COMPRESSION_MODE_CTRL">
- <bitfield name="STREAM1_DATATYPE" low="24" high="29"
type="uint"/>
- <bitfield name="STREAM1_PKT_PER_LINE" low="22" high="23"
type="uint"/>
- <bitfield name="STREAM1_EOL_BYTE_NUM" low="20" high="21"
type="uint"/>
- <bitfield name="STREAM1_EN" pos="16" type="boolean"/>
- <bitfield name="STREAM0_DATATYPE" low="8" high="13"
type="uint"/>
- <bitfield name="STREAM0_PKT_PER_LINE" low="6" high="7"
type="uint"/>
- <bitfield name="STREAM0_EOL_BYTE_NUM" low="4" high="5"
type="uint"/>
- <bitfield name="STREAM0_EN" pos="0" type="boolean"/>
+ <bitfield name="STREAM1" low="16" high="31"
type="COMPRESSION_MODE_CTRL"/>
+ <bitfield name="STREAM0" low="0" high="15"
type="COMPRESSION_MODE_CTRL"/>
</reg32>
<reg32 offset="0x002a8" name="COMMAND_COMPRESSION_MODE_CTRL2">
<bitfield name="STREAM1_SLICE_WIDTH" low="16" high="31"
type="uint"/>
--
With best wishes
Dmitry
next prev parent reply other threads:[~2022-05-02 10:02 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-30 17:55 [PATCH v2] drm/msm/dsi: use RMW cycles in dsi_update_dsc_timing Dmitry Baryshkov
2022-04-30 18:42 ` Abhinav Kumar
2022-04-30 18:58 ` Marijn Suijten
2022-04-30 19:25 ` [Freedreno] " Abhinav Kumar
2022-05-01 20:06 ` Marijn Suijten
2022-05-01 23:56 ` Abhinav Kumar
2022-05-02 8:02 ` Dmitry Baryshkov
2022-05-02 8:34 ` Marijn Suijten
2022-05-02 10:02 ` Dmitry Baryshkov [this message]
2022-05-02 21:56 ` Marijn Suijten
2022-04-30 19:28 ` Dmitry Baryshkov
2022-05-01 20:41 ` Marijn Suijten
2022-05-01 22:44 ` Dmitry Baryshkov
2022-05-02 8:43 ` Marijn Suijten
2022-05-02 9:41 ` Dmitry Baryshkov
2022-05-02 21:53 ` Marijn Suijten
2022-05-04 13:41 ` [Freedreno] " Vinod Koul
2022-05-04 13:38 ` Vinod Koul
2022-05-04 13:35 ` Vinod Koul
2022-05-04 13:31 ` [Freedreno] " Vinod Koul
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=f8986d6d-2c2b-a0a0-d63c-d4670f6864ff@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=lkp@intel.com \
--cc=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.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).