mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v3 0/4] drm/msm: add RGB101010 pixel format and fix 10-bit DSC timing
@ 2026-03-19 11:57 Alexander Koskovich
  2026-03-19 11:57 ` [PATCH v3 1/4] drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0 Alexander Koskovich
                   ` (3 more replies)
  0 siblings, 4 replies; 42+ messages in thread
From: Alexander Koskovich @ 2026-03-19 11:57 UTC (permalink / raw)
  To: Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	David Airlie, Simona Vetter, Rob Clark, Dmitry Baryshkov,
	Abhinav Kumar, Jessica Zhang, Sean Paul, Marijn Suijten,
	Jeffrey Hugo
  Cc: dri-devel, linux-kernel, linux-arm-msm, freedreno, Alexander Koskovich

This series adds support for the RGB101010 (30bpp) pixel format and
fixes a DSC timing bug exposed by non 8 bit panels.

Tested on the BOE BF068MWM-TD0 panel (10 bit DSC) on the Nothing
Phone (3a).

Signed-off-by: Alexander Koskovich <akoskovich@pm.me>
---
Changes in v3:
- Fix typo for MSM8998 DSI version name (V2_2 -> V_2_0)
- Add msm_dsi_host_version_is_gt per Konrad and use for RGB101010 check
- Fix up comment & commit message for video mode DSC INTF timing width change per Neil/Konrad
- Link to v2: https://lore.kernel.org/r/20260318-dsi-rgb101010-support-v2-0-698b7612eaeb@pm.me

Changes in v2:
- Only allow RGB101010 if MSM_DSI_6G_VER >= V2.1.0
- Link to v1: https://lore.kernel.org/r/20260318-dsi-rgb101010-support-v1-0-6021eb79e796@pm.me

---
Alexander Koskovich (4):
      drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0
      drm/msm/dsi: add DSI version >= comparison helper
      drm/msm/dsi: Add support for RGB101010 pixel format
      drm/msm/dpu: fix video mode DSC INTF timing width calculation

 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c    |  9 ++++-----
 drivers/gpu/drm/msm/dsi/dsi_cfg.c                   |  4 ++--
 drivers/gpu/drm/msm/dsi/dsi_cfg.h                   |  2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c                  | 21 +++++++++++++++++++--
 drivers/gpu/drm/msm/registers/display/dsi.xml       |  5 ++++-
 5 files changed, 30 insertions(+), 11 deletions(-)
---
base-commit: f338e77383789c0cae23ca3d48adcc5e9e137e3c
change-id: 20260318-dsi-rgb101010-support-4956b1cd8657

Best regards,
-- 
Alexander Koskovich <akoskovich@pm.me>



^ permalink raw reply	[flat|nested] 42+ messages in thread
* Re: [PATCH v3 4/4] drm/msm/dpu: fix video mode DSC INTF timing width calculation
@ 2026-03-20 12:07 Pengyu Luo
  2026-03-20 12:14 ` Alexander Koskovich
  0 siblings, 1 reply; 42+ messages in thread
From: Pengyu Luo @ 2026-03-20 12:07 UTC (permalink / raw)
  To: akoskovich
  Cc: Abhinav Kumar, David Airlie, Dmitry Baryshkov, dri-devel,
	freedreno, jeffrey.l.hugo, Jessica Zhang, Jonathan Marek,
	linux-arm-msm, linux-kernel, Dmitry Baryshkov, Maarten Lankhorst,
	Marijn Suijten, Maxime Ripard, Neil Armstrong, Rob Clark,
	Sean Paul, Simona Vetter, Thomas Zimmermann

On Fri, Mar 20, 2026 at 4:17 PM Alexander Koskovich <akoskovich@pm.me> wrote:
> >
> > On Friday, March 20th, 2026 at 3:36 AM, Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote:
> >
> > > On Fri, Mar 20, 2026 at 07:02:54AM +0000, Alexander Koskovich wrote:
> > > > On Friday, March 20th, 2026 at 2:50 AM, Alexander Koskovich <akoskovich@pm.me> wrote:
> > > >
> > > > > On Friday, March 20th, 2026 at 2:38 AM, Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> wrote:
> > > > >
> > > > > > On Fri, Mar 20, 2026 at 04:46:02AM +0000, Alexander Koskovich wrote:
> > > > > > > On Friday, March 20th, 2026 at 12:25 AM, Jonathan Marek <jonathan@marek.ca> wrote:
> > > > > > >
> > > > > > > > On 3/19/26 9:45 PM, Dmitry Baryshkov wrote:
> > > > > > > > > On Thu, Mar 19, 2026 at 01:23:03PM -0400, Jonathan Marek wrote:
> > > > > > > > ...
> > > > > > > > >>
> > > > > > > > >> That's not how it works. INTF (which feeds DSI) is after DSC compression.
> > > > > > > > >>
> > > > > > > > >> INTF timings are always in RGB888 (24-bit) units. Ignoring widebus details,
> > > > > > > > >> the INTF timing should match what is programmed on the DSI side (hdisplay,
> > > > > > > > >> which is calculated as bytes per line / 3).
> > > > > > > > >>
> > > > > > > > >> (fwiw, the current "timing->width = ..." calculation here blames to me, but
> > > > > > > > >> what I wrote originally was just "timing->width = timing->width / 3" with a
> > > > > > > > >> comment about being incomplete.)
> > > > > > > > >>
> > > > > > > > > Okay. After reading the docs (sorry, it took a while).
> > > > > > > > >
> > > > > > > > > - When widebus is not enabled, the transfer is always 24 bit of
> > > > > > > > >    compressed data. Thus if it is not in play, pclk and timing->width
> > > > > > > > >    should be scaled by source_pixel_depth / compression_ratio / 24. In
> > > > > > > > >    case of the code it is 'drm_dsc_get_bpp_int(dsc) / 24'.
> > > > > > > > >
> > > > > > > > >    For RGB101010 / 8bpp DSC this should result in the PCLK being lowered
> > > > > > > > >    by the factor of 3 (= 24 / (30 / 3.75))
> > > > > > > > >
> > > > > > > > > - When widebus is in play (MDSS 6.x+, DSI 2.4+), the transfer takes
> > > > > > > > >    more than 24 bits. In this case the PCLK and timing->width should be
> > > > > > > > >    scaled exactly by the DSC compression ratio, which is
> > > > > > > > >    'drm_dsc_get_bpp_int(dsc) / (3 * dsc->bits_per_component).
> > > > > > > > >
> > > > > > > > > So, this piece of code needs to be adjusted to check for the widebus
> > > > > > > > > being enabled or not.
> > > > > > > > >
> > > > > > > >
> > > > > > > > The widebus adjustment on the MDP/INTF side is already in
> > > > > > > > dpu_hw_intf_setup_timing_engine: the "data width" is divided by 2 for
> > > > > > > > 48-bit widebus instead of 24-bit. there shouldn't be any other
> > > > > > > > adjustment (downstream doesn't have any other adjustment).
> > > > > > > >
> > > > > > > > a relevant downstream comment: "In DATABUS-WIDEN mode, MDP always sends
> > > > > > > > out 48-bit compressed data per pclk and on average, DSI consumes an
> > > > > > > > amount of compressed data equivalent to the uncompressed pixel depth per
> > > > > > > > pclk."
> > > > > > > >
> > > > > > > > Based on that comment, this patch is correct, and the
> > > > > > > > ''drm_dsc_get_bpp_int(dsc) / (3 * dsc->bits_per_component)' adjustment
> > > > > > > > only applies to DSI.
> > > > > > >
> > > > > > > If I keep the INTF side at /24 and change the DSI side to:
> > > > > > >
> > > > > > > if (wide_bus)
> > > > > > >         new_hdisplay = DIV_ROUND_UP(mode->hdisplay * drm_dsc_get_bpp_int(dsc), dsc->bits_per_component * 3);
> > > > > > > else
> > > > > > >         new_hdisplay = DIV_ROUND_UP(mode->hdisplay * drm_dsc_get_bpp_int(dsc), 24);
> > > > > >
> > > > > > Please check the actual fps (I'm usually using a vblank-synced GL, e.g.
> > > > > > kmscube).
> > > > > >
> > > > > > At least this matches my expectations.
> > > > >
> > > > > Hmmm with kmscube I am getting 120FPS with 24 and 100FPS with 30. So I guess that's a no go
> > > >
> > > > Although it was using dsc->bits_per_component * 3 regardless before for
> > > > dsi_adjust_pclk_for_compression so I guess that's what Jonathan was
> > > > referring to earlier...
> > >
> > > Do you have any of the patches by Marijn or Pengyu?
> > >
> > > - https://lore.kernel.org/linux-arm-msm/20260311-dsi-dsc-regresses-again-v1-1-6a422141eeea@somainline.org/
> > >
> > > - https://lore.kernel.org/linux-arm-msm/20260307111250.105772-1-mitltlatltl@gmail.com/
> >
> > Nope, I can test with them though if you'd like
>
> Tested the following 3 patches on top of this series:
> drm/msm/dsi: fix hdisplay calculation when programming dsi registers
> drm/msm/dsi: fix bits_per_pclk
> drm/msm/dsi: fix hdisplay calculation for CMD mode panel
>
> Getting constant FIFO errors with them applied:
> [   64.851635] dsi_err_worker: status=4
> [   64.851692] dsi_err_worker: status=4
> [   64.851730] dsi_err_worker: status=4
> [   64.851766] dsi_err_worker: status=4
> [   64.851802] dsi_err_worker: status=4
> [   64.851837] dsi_err_worker: status=4
> [   64.851903] dsi_err_worker: status=4
> [   64.851940] dsi_err_worker: status=4
> [   64.851976] dsi_err_worker: status=4
> [   64.852011] dsi_err_worker: status=4

Personally, I use
timing->width = DIV_ROUND_UP(timing->width * drm_dsc_get_bpp_int(dsc),
                         dsc->bits_per_component * 3);

DIV_ROUND_UP is magic for me. If not, I got status=4 too.

This works for 8-bit dst bpc with 10-bit src bpc.

Best wishes,
Pengyu

^ permalink raw reply	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2026-03-21  8:23 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-03-19 11:57 [PATCH v3 0/4] drm/msm: add RGB101010 pixel format and fix 10-bit DSC timing Alexander Koskovich
2026-03-19 11:57 ` [PATCH v3 1/4] drm/msm/dsi: rename MSM8998 DSI version from V2_2_0 to V2_0_0 Alexander Koskovich
2026-03-19 12:05   ` Konrad Dybcio
2026-03-19 18:50   ` Dmitry Baryshkov
2026-03-19 11:57 ` [PATCH v3 2/4] drm/msm/dsi: add DSI version >= comparison helper Alexander Koskovich
2026-03-19 12:08   ` Konrad Dybcio
2026-03-19 18:50   ` Dmitry Baryshkov
2026-03-19 18:54   ` Dmitry Baryshkov
2026-03-19 11:57 ` [PATCH v3 3/4] drm/msm/dsi: Add support for RGB101010 pixel format Alexander Koskovich
2026-03-19 12:12   ` Konrad Dybcio
2026-03-19 18:59   ` Dmitry Baryshkov
2026-03-19 19:03     ` Alexander Koskovich
2026-03-20  9:22   ` kernel test robot
2026-03-20 17:58   ` kernel test robot
2026-03-19 11:58 ` [PATCH v3 4/4] drm/msm/dpu: fix video mode DSC INTF timing width calculation Alexander Koskovich
2026-03-19 14:09   ` Neil Armstrong
2026-03-19 14:40     ` Alexander Koskovich
2026-03-19 14:54       ` Neil Armstrong
2026-03-19 17:23         ` Jonathan Marek
2026-03-19 17:31           ` Alexander Koskovich
2026-03-19 19:02             ` Jonathan Marek
2026-03-20  1:45           ` Dmitry Baryshkov
2026-03-20  3:55             ` Alexander Koskovich
2026-03-20  4:25             ` Jonathan Marek
2026-03-20  4:46               ` Alexander Koskovich
2026-03-20  6:38                 ` Dmitry Baryshkov
2026-03-20  6:50                   ` Alexander Koskovich
2026-03-20  7:02                     ` Alexander Koskovich
2026-03-20  7:36                       ` Dmitry Baryshkov
2026-03-20  7:47                         ` Alexander Koskovich
2026-03-20  8:17                           ` Alexander Koskovich
2026-03-20  7:02               ` Dmitry Baryshkov
2026-03-20  7:34               ` Dmitry Baryshkov
2026-03-19 19:05     ` Dmitry Baryshkov
2026-03-20 12:07 Pengyu Luo
2026-03-20 12:14 ` Alexander Koskovich
2026-03-20 12:18   ` Pengyu Luo
2026-03-20 13:18     ` Alexander Koskovich
2026-03-20 13:31       ` Pengyu Luo
2026-03-20 19:12         ` Alexander Koskovich
2026-03-21  5:19           ` Pengyu Luo
2026-03-21  8:22           ` Pengyu Luo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome