All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2022-12-21 23:19 ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

This preliminary Display Stream Compression support package for
(initially tested on) sm8[12]50 is based on comparing DSC behaviour
between downstream and mainline.  Some new callbacks are added (for
binding blocks on active CTLs), logic bugs are corrected, zeroed struct
members are now assigned proper values, and RM allocation and hw block
retrieval now hand out (or not) DSC blocks without causing null-pointer
dereferences.

Unfortunately it is not yet enough to get rid of completely corrupted
display output on the boards I tested here:
- Sony Xperia 1 (sm8150), 1644x3840 or 1096x2560 pixels;
- Sony Xperia 5II (sm8250), 1080x2520, at 60 or 120Hz;
- (can include more Xperia boards if desired)

Both devices use the DUALPIPE_DSCMERGE topology downstream: dual LM, PP
and DSC, but only a single INTF/encoder/DSI-link.

Hopefully this spawns some community/upstream interest to help rootcause
our corruption issues (after we open a drm/msm report on GitLab for more
appropriate tracking).

The Sony Xperia XZ3 (sdm845) was fully tested and validated with this
series to not cause any regressions (and one of the math fixes now
allows us to change slice_count in the panel driver, which would corrupt
previously).

Changes since v1:

- Split patch 6 into two separately backportable Fixes: patches;
- Additionally remove num_enc from msm_display_topology in favour of
  num_dsc;
- Reorder patches to have all Fixes: at the beginning for easier
  picking;
- Fix existing multiline comment while editing it anyway;
- Add missing Signed-off-by to patch 5.

v1: https://lore.kernel.org/linux-arm-msm/20221213232207.113607-1-marijn.suijten@somainline.org/T/#u

Marijn Suijten (8):
  drm/msm/dpu: Wire up DSC mask for active CTL configuration
  drm/msm/dsi: Use DSC slice(s) packet size to compute word count
  drm/msm/dsi: Flip greater-than check for slice_count and
    slice_per_intf
  drm/msm/dpu: Disallow unallocated resources to be returned
  drm/msm/dpu: Reject topologies for which no DSC blocks are available
  drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
  drm/msm/dpu: Implement DSC binding to PP block for CTL V1
  drm/msm/dpu: Add DSC configuration for SM8150 and SM8250

 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 12 +++++----
 .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c  |  1 +
 .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |  1 +
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    | 23 +++++++++++-----
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  9 +++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c    | 27 +++++++++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h    |  4 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c        | 14 ++++++++--
 drivers/gpu/drm/msm/dsi/dsi_host.c            |  7 ++---
 drivers/gpu/drm/msm/msm_drv.h                 |  2 --
 10 files changed, 82 insertions(+), 18 deletions(-)

--
2.39.0


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

* [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2022-12-21 23:19 ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

This preliminary Display Stream Compression support package for
(initially tested on) sm8[12]50 is based on comparing DSC behaviour
between downstream and mainline.  Some new callbacks are added (for
binding blocks on active CTLs), logic bugs are corrected, zeroed struct
members are now assigned proper values, and RM allocation and hw block
retrieval now hand out (or not) DSC blocks without causing null-pointer
dereferences.

Unfortunately it is not yet enough to get rid of completely corrupted
display output on the boards I tested here:
- Sony Xperia 1 (sm8150), 1644x3840 or 1096x2560 pixels;
- Sony Xperia 5II (sm8250), 1080x2520, at 60 or 120Hz;
- (can include more Xperia boards if desired)

Both devices use the DUALPIPE_DSCMERGE topology downstream: dual LM, PP
and DSC, but only a single INTF/encoder/DSI-link.

Hopefully this spawns some community/upstream interest to help rootcause
our corruption issues (after we open a drm/msm report on GitLab for more
appropriate tracking).

The Sony Xperia XZ3 (sdm845) was fully tested and validated with this
series to not cause any regressions (and one of the math fixes now
allows us to change slice_count in the panel driver, which would corrupt
previously).

Changes since v1:

- Split patch 6 into two separately backportable Fixes: patches;
- Additionally remove num_enc from msm_display_topology in favour of
  num_dsc;
- Reorder patches to have all Fixes: at the beginning for easier
  picking;
- Fix existing multiline comment while editing it anyway;
- Add missing Signed-off-by to patch 5.

v1: https://lore.kernel.org/linux-arm-msm/20221213232207.113607-1-marijn.suijten@somainline.org/T/#u

Marijn Suijten (8):
  drm/msm/dpu: Wire up DSC mask for active CTL configuration
  drm/msm/dsi: Use DSC slice(s) packet size to compute word count
  drm/msm/dsi: Flip greater-than check for slice_count and
    slice_per_intf
  drm/msm/dpu: Disallow unallocated resources to be returned
  drm/msm/dpu: Reject topologies for which no DSC blocks are available
  drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
  drm/msm/dpu: Implement DSC binding to PP block for CTL V1
  drm/msm/dpu: Add DSC configuration for SM8150 and SM8250

 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 12 +++++----
 .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c  |  1 +
 .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |  1 +
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    | 23 +++++++++++-----
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  9 +++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c    | 27 +++++++++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h    |  4 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c        | 14 ++++++++--
 drivers/gpu/drm/msm/dsi/dsi_host.c            |  7 ++---
 drivers/gpu/drm/msm/msm_drv.h                 |  2 --
 10 files changed, 82 insertions(+), 18 deletions(-)

--
2.39.0


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

* [PATCH v2 1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

Active CTLs have to configure what DSC block(s) have to be enabled, and
what DSC block(s) have to be flushed; this value was initialized to zero
resulting in the necessary register writes to never happen (or would
write zero otherwise).  This seems to have gotten lost in the DSC v4->v5
series while refactoring how the combination with merge_3d was handled.

Fixes: 58dca9810749 ("drm/msm/disp/dpu1: Add support for DSC in encoder")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index ae28b2b93e69..35791f93c33d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -61,6 +61,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg(
 	intf_cfg.intf_mode_sel = DPU_CTL_MODE_SEL_CMD;
 	intf_cfg.stream_sel = cmd_enc->stream_sel;
 	intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
+	intf_cfg.dsc = dpu_encoder_helper_get_dsc(phys_enc);
 	ctl->ops.setup_intf_cfg(ctl, &intf_cfg);
 
 	/* setup which pp blk will connect to this intf */
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index 0f71e8fe7be7..9ee3a7306a5f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -274,6 +274,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
 	intf_cfg.intf_mode_sel = DPU_CTL_MODE_SEL_VID;
 	intf_cfg.stream_sel = 0; /* Don't care value for video mode */
 	intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
+	intf_cfg.dsc = dpu_encoder_helper_get_dsc(phys_enc);
 	if (phys_enc->hw_pp->merge_3d)
 		intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx;
 
-- 
2.39.0


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

* [PATCH v2 1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

Active CTLs have to configure what DSC block(s) have to be enabled, and
what DSC block(s) have to be flushed; this value was initialized to zero
resulting in the necessary register writes to never happen (or would
write zero otherwise).  This seems to have gotten lost in the DSC v4->v5
series while refactoring how the combination with merge_3d was handled.

Fixes: 58dca9810749 ("drm/msm/disp/dpu1: Add support for DSC in encoder")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 +
 2 files changed, 2 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
index ae28b2b93e69..35791f93c33d 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c
@@ -61,6 +61,7 @@ static void _dpu_encoder_phys_cmd_update_intf_cfg(
 	intf_cfg.intf_mode_sel = DPU_CTL_MODE_SEL_CMD;
 	intf_cfg.stream_sel = cmd_enc->stream_sel;
 	intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
+	intf_cfg.dsc = dpu_encoder_helper_get_dsc(phys_enc);
 	ctl->ops.setup_intf_cfg(ctl, &intf_cfg);
 
 	/* setup which pp blk will connect to this intf */
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
index 0f71e8fe7be7..9ee3a7306a5f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c
@@ -274,6 +274,7 @@ static void dpu_encoder_phys_vid_setup_timing_engine(
 	intf_cfg.intf_mode_sel = DPU_CTL_MODE_SEL_VID;
 	intf_cfg.stream_sel = 0; /* Don't care value for video mode */
 	intf_cfg.mode_3d = dpu_encoder_helper_get_3d_blend_mode(phys_enc);
+	intf_cfg.dsc = dpu_encoder_helper_get_dsc(phys_enc);
 	if (phys_enc->hw_pp->merge_3d)
 		intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx;
 
-- 
2.39.0


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

* [PATCH v2 2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Marek Vasut

According to downstream the value to use for WORD_COUNT is
bytes_per_pkt, which denotes the number of bytes in a packet based on
how many slices have been configured by the panel driver times the
width of a slice times the number of bytes per pixel.

The DSC panels seen thus far use one byte per pixel, only one slice
per packet, and a slice width of half the panel width leading to the
desired bytes_per_pkt+1 value to be equal to hdisplay/2+1.  This however
isn't the case anymore for panels that configure two slices per packet,
where the value should now be hdisplay+1.

Note that the aforementioned panel (on a Sony Xperia XZ3, sdm845) with
slice_count=1 has also been tested to successfully accept slice_count=2,
which would have shown corrupted output previously.

Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index b83cf70b1adb..0686c35a6fd4 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -989,7 +989,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
 		if (!msm_host->dsc)
 			wc = hdisplay * dsi_get_bpp(msm_host->format) / 8 + 1;
 		else
-			wc = mode->hdisplay / 2 + 1;
+			wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count + 1;
 
 		dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL,
 			DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |
-- 
2.39.0


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

* [PATCH v2 2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Marek Vasut, Haowen Bai, Sam Ravnborg, Kuogee Hsieh,
	Jessica Zhang, Jani Nikula, linux-arm-msm, Stephen Boyd,
	Martin Botka, ~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

According to downstream the value to use for WORD_COUNT is
bytes_per_pkt, which denotes the number of bytes in a packet based on
how many slices have been configured by the panel driver times the
width of a slice times the number of bytes per pixel.

The DSC panels seen thus far use one byte per pixel, only one slice
per packet, and a slice width of half the panel width leading to the
desired bytes_per_pkt+1 value to be equal to hdisplay/2+1.  This however
isn't the case anymore for panels that configure two slices per packet,
where the value should now be hdisplay+1.

Note that the aforementioned panel (on a Sony Xperia XZ3, sdm845) with
slice_count=1 has also been tested to successfully accept slice_count=2,
which would have shown corrupted output previously.

Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index b83cf70b1adb..0686c35a6fd4 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -989,7 +989,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
 		if (!msm_host->dsc)
 			wc = hdisplay * dsi_get_bpp(msm_host->format) / 8 + 1;
 		else
-			wc = mode->hdisplay / 2 + 1;
+			wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count + 1;
 
 		dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL,
 			DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |
-- 
2.39.0


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

* [PATCH v2 3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

According to downstream /and the comment copied from it/ this comparison
should be the other way around.  In other words, when the panel driver
requests to use more slices per packet than what could be sent over this
interface, it is bumped down to only use a single slice per packet (and
strangely not the number of slices that could fit on the interface).

Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 0686c35a6fd4..3409a4275d4a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -855,11 +855,12 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
 	 */
 	slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width);
 
-	/* If slice_per_pkt is greater than slice_per_intf
+	/*
+	 * If slice_count is greater than slice_per_intf
 	 * then default to 1. This can happen during partial
 	 * update.
 	 */
-	if (slice_per_intf > dsc->slice_count)
+	if (dsc->slice_count > slice_per_intf)
 		dsc->slice_count = 1;
 
 	total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
-- 
2.39.0


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

* [PATCH v2 3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

According to downstream /and the comment copied from it/ this comparison
should be the other way around.  In other words, when the panel driver
requests to use more slices per packet than what could be sent over this
interface, it is bumped down to only use a single slice per packet (and
strangely not the number of slices that could fit on the interface).

Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 0686c35a6fd4..3409a4275d4a 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -855,11 +855,12 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
 	 */
 	slice_per_intf = DIV_ROUND_UP(hdisplay, dsc->slice_width);
 
-	/* If slice_per_pkt is greater than slice_per_intf
+	/*
+	 * If slice_count is greater than slice_per_intf
 	 * then default to 1. This can happen during partial
 	 * update.
 	 */
-	if (slice_per_intf > dsc->slice_count)
+	if (dsc->slice_count > slice_per_intf)
 		dsc->slice_count = 1;
 
 	total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
-- 
2.39.0


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

* [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

In the event that the topology requests resources that have not been
created by the system (because they are typically not represented in
dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
blocks) remain NULL but will still be returned out of
dpu_rm_get_assigned_resources, where the caller expects to get an array
containing num_blks valid pointers (but instead gets these NULLs).

To prevent this from happening, where null-pointer dereferences
typically result in a hard-to-debug platform lockup, num_blks shouldn't
increase past NULL blocks and will print an error and break instead.
After all, max_blks represents the static size of the maximum number of
blocks whereas the actual amount varies per platform.

^1: which can happen after a git rebase ended up moving additions to
_dpu_cfg to a different struct which has the same patch context.

Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index 73b3442e7467..8471d04bff50 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -660,6 +660,11 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
 				  blks_size, enc_id);
 			break;
 		}
+		if (!hw_blks[i]) {
+			DPU_ERROR("No more resource %d available to assign to enc %d\n",
+				  type, enc_id);
+			break;
+		}
 		blks[num_blks++] = hw_blks[i];
 	}
 
-- 
2.39.0


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

* [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno

In the event that the topology requests resources that have not been
created by the system (because they are typically not represented in
dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
blocks) remain NULL but will still be returned out of
dpu_rm_get_assigned_resources, where the caller expects to get an array
containing num_blks valid pointers (but instead gets these NULLs).

To prevent this from happening, where null-pointer dereferences
typically result in a hard-to-debug platform lockup, num_blks shouldn't
increase past NULL blocks and will print an error and break instead.
After all, max_blks represents the static size of the maximum number of
blocks whereas the actual amount varies per platform.

^1: which can happen after a git rebase ended up moving additions to
_dpu_cfg to a different struct which has the same patch context.

Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index 73b3442e7467..8471d04bff50 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -660,6 +660,11 @@ int dpu_rm_get_assigned_resources(struct dpu_rm *rm,
 				  blks_size, enc_id);
 			break;
 		}
+		if (!hw_blks[i]) {
+			DPU_ERROR("No more resource %d available to assign to enc %d\n",
+				  type, enc_id);
+			break;
+		}
 		blks[num_blks++] = hw_blks[i];
 	}
 
-- 
2.39.0


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

* [PATCH v2 5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

Resource allocation of DSC blocks should behave more like LMs and CTLs
where NULL resources (based on initial hw_blk creation via definitions
in the catalog) are skipped ^1.  The current hardcoded mapping of DSC
blocks however means that resource allocation shouldn't succeed at all
when the DSC block on the corresponding index doesn't exist, rather than
searching for the next free block.

This hardcoded mapping should be loosened separately as DPU 5.0.0
introduced a crossbar where DSC blocks can be "somewhat" freely bound to
any PP and CTL (in proper pairs).

^1: which, on hardware that supports DSC, can happen after a git rebase
ended up moving additions to _dpu_cfg to a different struct which has
the same patch context.

Fixes: f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index 8471d04bff50..dcbf03d2940a 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -496,6 +496,11 @@ static int _dpu_rm_reserve_dsc(struct dpu_rm *rm,
 
 	/* check if DSC required are allocated or not */
 	for (i = 0; i < num_dsc; i++) {
+		if (!rm->dsc_blks[i]) {
+			DPU_ERROR("DSC %d does not exist\n", i);
+			return -EIO;
+		}
+
 		if (global_state->dsc_to_enc_id[i]) {
 			DPU_ERROR("DSC %d is already allocated\n", i);
 			return -EIO;
-- 
2.39.0


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

* [PATCH v2 5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

Resource allocation of DSC blocks should behave more like LMs and CTLs
where NULL resources (based on initial hw_blk creation via definitions
in the catalog) are skipped ^1.  The current hardcoded mapping of DSC
blocks however means that resource allocation shouldn't succeed at all
when the DSC block on the corresponding index doesn't exist, rather than
searching for the next free block.

This hardcoded mapping should be loosened separately as DPU 5.0.0
introduced a crossbar where DSC blocks can be "somewhat" freely bound to
any PP and CTL (in proper pairs).

^1: which, on hardware that supports DSC, can happen after a git rebase
ended up moving additions to _dpu_cfg to a different struct which has
the same patch context.

Fixes: f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index 8471d04bff50..dcbf03d2940a 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -496,6 +496,11 @@ static int _dpu_rm_reserve_dsc(struct dpu_rm *rm,
 
 	/* check if DSC required are allocated or not */
 	for (i = 0; i < num_dsc; i++) {
+		if (!rm->dsc_blks[i]) {
+			DPU_ERROR("DSC %d does not exist\n", i);
+			return -EIO;
+		}
+
 		if (global_state->dsc_to_enc_id[i]) {
 			DPU_ERROR("DSC %d is already allocated\n", i);
 			return -EIO;
-- 
2.39.0


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

* [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

Downstream calls this num_enc yet the DSC patches introduced a new
num_dsc struct member, leaving num_enc effectively unused.

Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
 drivers/gpu/drm/msm/msm_drv.h               | 2 --
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 9c6817b5a194..a158cd502d38 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
 			topology.num_dspp = topology.num_lm;
 	}
 
-	topology.num_enc = 0;
 	topology.num_intf = intf_count;
 
 	if (dpu_enc->dsc) {
-		/* In case of Display Stream Compression (DSC), we would use
-		 * 2 encoders, 2 layer mixers and 1 interface
+		/*
+		 * In case of Display Stream Compression (DSC), we would use
+		 * 2 DSC encoders, 2 layer mixers and 1 interface
 		 * this is power optimal and can drive up to (including) 4k
 		 * screens
 		 */
-		topology.num_enc = 2;
 		topology.num_dsc = 2;
-		topology.num_intf = 1;
 		topology.num_lm = 2;
+		topology.num_intf = 1;
 	}
 
 	return topology;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index dcbf03d2940a..5e7aa0f3a31c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -548,8 +548,8 @@ static int _dpu_rm_populate_requirements(
 {
 	reqs->topology = req_topology;
 
-	DRM_DEBUG_KMS("num_lm: %d num_enc: %d num_intf: %d\n",
-		      reqs->topology.num_lm, reqs->topology.num_enc,
+	DRM_DEBUG_KMS("num_lm: %d num_dsc: %d num_intf: %d\n",
+		      reqs->topology.num_lm, reqs->topology.num_dsc,
 		      reqs->topology.num_intf);
 
 	return 0;
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index d4e0ef608950..74626a271f46 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -82,14 +82,12 @@ enum msm_event_wait {
 /**
  * struct msm_display_topology - defines a display topology pipeline
  * @num_lm:       number of layer mixers used
- * @num_enc:      number of compression encoder blocks used
  * @num_intf:     number of interfaces the panel is mounted on
  * @num_dspp:     number of dspp blocks used
  * @num_dsc:      number of Display Stream Compression (DSC) blocks used
  */
 struct msm_display_topology {
 	u32 num_lm;
-	u32 num_enc;
 	u32 num_intf;
 	u32 num_dspp;
 	u32 num_dsc;
-- 
2.39.0


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

* [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

Downstream calls this num_enc yet the DSC patches introduced a new
num_dsc struct member, leaving num_enc effectively unused.

Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
 drivers/gpu/drm/msm/msm_drv.h               | 2 --
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index 9c6817b5a194..a158cd502d38 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
 			topology.num_dspp = topology.num_lm;
 	}
 
-	topology.num_enc = 0;
 	topology.num_intf = intf_count;
 
 	if (dpu_enc->dsc) {
-		/* In case of Display Stream Compression (DSC), we would use
-		 * 2 encoders, 2 layer mixers and 1 interface
+		/*
+		 * In case of Display Stream Compression (DSC), we would use
+		 * 2 DSC encoders, 2 layer mixers and 1 interface
 		 * this is power optimal and can drive up to (including) 4k
 		 * screens
 		 */
-		topology.num_enc = 2;
 		topology.num_dsc = 2;
-		topology.num_intf = 1;
 		topology.num_lm = 2;
+		topology.num_intf = 1;
 	}
 
 	return topology;
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
index dcbf03d2940a..5e7aa0f3a31c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
@@ -548,8 +548,8 @@ static int _dpu_rm_populate_requirements(
 {
 	reqs->topology = req_topology;
 
-	DRM_DEBUG_KMS("num_lm: %d num_enc: %d num_intf: %d\n",
-		      reqs->topology.num_lm, reqs->topology.num_enc,
+	DRM_DEBUG_KMS("num_lm: %d num_dsc: %d num_intf: %d\n",
+		      reqs->topology.num_lm, reqs->topology.num_dsc,
 		      reqs->topology.num_intf);
 
 	return 0;
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index d4e0ef608950..74626a271f46 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -82,14 +82,12 @@ enum msm_event_wait {
 /**
  * struct msm_display_topology - defines a display topology pipeline
  * @num_lm:       number of layer mixers used
- * @num_enc:      number of compression encoder blocks used
  * @num_intf:     number of interfaces the panel is mounted on
  * @num_dspp:     number of dspp blocks used
  * @num_dsc:      number of Display Stream Compression (DSC) blocks used
  */
 struct msm_display_topology {
 	u32 num_lm;
-	u32 num_enc;
 	u32 num_intf;
 	u32 num_dspp;
 	u32 num_dsc;
-- 
2.39.0


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

* [PATCH v2 7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

All V1 CTL blocks (active CTLs) explicitly bind the pixel output from a
DSC block to a PINGPONG block by setting the PINGPONG index in a DSC
hardware register.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   |  3 +++
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  9 +++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c    | 27 +++++++++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h    |  4 +++
 4 files changed, 43 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index a158cd502d38..19fb20a6ed72 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1829,6 +1829,9 @@ static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_dsc *hw_dsc,
 	if (hw_pp->ops.setup_dsc)
 		hw_pp->ops.setup_dsc(hw_pp);
 
+	if (hw_dsc->ops.dsc_bind_pingpong_blk)
+		hw_dsc->ops.dsc_bind_pingpong_blk(hw_dsc, true, hw_pp->idx);
+
 	if (hw_pp->ops.enable_dsc)
 		hw_pp->ops.enable_dsc(hw_pp);
 }
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
index c160dae95a69..96f849907aa2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
@@ -268,6 +268,15 @@ enum {
 	DPU_VBIF_MAX
 };
 
+/**
+ * DSC features
+ * @DPU_DSC_OUTPUT_CTRL       Configure which PINGPONG block gets
+ *                            the pixel output from this DSC.
+ */
+enum {
+	DPU_DSC_OUTPUT_CTRL = 0x1,
+};
+
 /**
  * MACRO DPU_HW_BLK_INFO - information of HW blocks inside DPU
  * @name:              string name for debug purposes
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
index 3662df698dae..619926da1441 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
@@ -29,6 +29,8 @@
 #define DSC_RANGE_MAX_QP                0x0B0
 #define DSC_RANGE_BPG_OFFSET            0x0EC
 
+#define DSC_CTL(m) (0x1800 - 0x3FC * (m - DSC_0))
+
 static void dpu_hw_dsc_disable(struct dpu_hw_dsc *dsc)
 {
 	struct dpu_hw_blk_reg_map *c = &dsc->hw;
@@ -150,6 +152,29 @@ static void dpu_hw_dsc_config_thresh(struct dpu_hw_dsc *hw_dsc,
 	}
 }
 
+static void dpu_hw_dsc_bind_pingpong_blk(
+		struct dpu_hw_dsc *hw_dsc,
+		bool enable,
+		const enum dpu_pingpong pp)
+{
+	struct dpu_hw_blk_reg_map *c = &hw_dsc->hw;
+	int mux_cfg = 0xF;
+	u32 dsc_ctl_offset;
+
+	dsc_ctl_offset = DSC_CTL(hw_dsc->idx);
+
+	if (enable)
+		mux_cfg = (pp - PINGPONG_0) & 0x7;
+
+	DRM_DEBUG_KMS("%s dsc:%d %s pp:%d\n",
+			enable ? "Binding" : "Unbinding",
+			hw_dsc->idx - DSC_0,
+			enable ? "to" : "from",
+			pp - PINGPONG_0);
+
+	DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg);
+}
+
 static struct dpu_dsc_cfg *_dsc_offset(enum dpu_dsc dsc,
 				       const struct dpu_mdss_cfg *m,
 				       void __iomem *addr,
@@ -174,6 +199,8 @@ static void _setup_dsc_ops(struct dpu_hw_dsc_ops *ops,
 	ops->dsc_disable = dpu_hw_dsc_disable;
 	ops->dsc_config = dpu_hw_dsc_config;
 	ops->dsc_config_thresh = dpu_hw_dsc_config_thresh;
+	if (cap & BIT(DPU_DSC_OUTPUT_CTRL))
+		ops->dsc_bind_pingpong_blk = dpu_hw_dsc_bind_pingpong_blk;
 };
 
 struct dpu_hw_dsc *dpu_hw_dsc_init(enum dpu_dsc idx, void __iomem *addr,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h
index c0b77fe1a696..ae9b5db53d7f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h
@@ -42,6 +42,10 @@ struct dpu_hw_dsc_ops {
 	 */
 	void (*dsc_config_thresh)(struct dpu_hw_dsc *hw_dsc,
 				  struct drm_dsc_config *dsc);
+
+	void (*dsc_bind_pingpong_blk)(struct dpu_hw_dsc *hw_dsc,
+				  bool enable,
+				  enum dpu_pingpong pp);
 };
 
 struct dpu_hw_dsc {
-- 
2.39.0


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

* [PATCH v2 7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

All V1 CTL blocks (active CTLs) explicitly bind the pixel output from a
DSC block to a PINGPONG block by setting the PINGPONG index in a DSC
hardware register.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   |  3 +++
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  9 +++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c    | 27 +++++++++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h    |  4 +++
 4 files changed, 43 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
index a158cd502d38..19fb20a6ed72 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
@@ -1829,6 +1829,9 @@ static void dpu_encoder_dsc_pipe_cfg(struct dpu_hw_dsc *hw_dsc,
 	if (hw_pp->ops.setup_dsc)
 		hw_pp->ops.setup_dsc(hw_pp);
 
+	if (hw_dsc->ops.dsc_bind_pingpong_blk)
+		hw_dsc->ops.dsc_bind_pingpong_blk(hw_dsc, true, hw_pp->idx);
+
 	if (hw_pp->ops.enable_dsc)
 		hw_pp->ops.enable_dsc(hw_pp);
 }
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
index c160dae95a69..96f849907aa2 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h
@@ -268,6 +268,15 @@ enum {
 	DPU_VBIF_MAX
 };
 
+/**
+ * DSC features
+ * @DPU_DSC_OUTPUT_CTRL       Configure which PINGPONG block gets
+ *                            the pixel output from this DSC.
+ */
+enum {
+	DPU_DSC_OUTPUT_CTRL = 0x1,
+};
+
 /**
  * MACRO DPU_HW_BLK_INFO - information of HW blocks inside DPU
  * @name:              string name for debug purposes
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
index 3662df698dae..619926da1441 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
@@ -29,6 +29,8 @@
 #define DSC_RANGE_MAX_QP                0x0B0
 #define DSC_RANGE_BPG_OFFSET            0x0EC
 
+#define DSC_CTL(m) (0x1800 - 0x3FC * (m - DSC_0))
+
 static void dpu_hw_dsc_disable(struct dpu_hw_dsc *dsc)
 {
 	struct dpu_hw_blk_reg_map *c = &dsc->hw;
@@ -150,6 +152,29 @@ static void dpu_hw_dsc_config_thresh(struct dpu_hw_dsc *hw_dsc,
 	}
 }
 
+static void dpu_hw_dsc_bind_pingpong_blk(
+		struct dpu_hw_dsc *hw_dsc,
+		bool enable,
+		const enum dpu_pingpong pp)
+{
+	struct dpu_hw_blk_reg_map *c = &hw_dsc->hw;
+	int mux_cfg = 0xF;
+	u32 dsc_ctl_offset;
+
+	dsc_ctl_offset = DSC_CTL(hw_dsc->idx);
+
+	if (enable)
+		mux_cfg = (pp - PINGPONG_0) & 0x7;
+
+	DRM_DEBUG_KMS("%s dsc:%d %s pp:%d\n",
+			enable ? "Binding" : "Unbinding",
+			hw_dsc->idx - DSC_0,
+			enable ? "to" : "from",
+			pp - PINGPONG_0);
+
+	DPU_REG_WRITE(c, dsc_ctl_offset, mux_cfg);
+}
+
 static struct dpu_dsc_cfg *_dsc_offset(enum dpu_dsc dsc,
 				       const struct dpu_mdss_cfg *m,
 				       void __iomem *addr,
@@ -174,6 +199,8 @@ static void _setup_dsc_ops(struct dpu_hw_dsc_ops *ops,
 	ops->dsc_disable = dpu_hw_dsc_disable;
 	ops->dsc_config = dpu_hw_dsc_config;
 	ops->dsc_config_thresh = dpu_hw_dsc_config_thresh;
+	if (cap & BIT(DPU_DSC_OUTPUT_CTRL))
+		ops->dsc_bind_pingpong_blk = dpu_hw_dsc_bind_pingpong_blk;
 };
 
 struct dpu_hw_dsc *dpu_hw_dsc_init(enum dpu_dsc idx, void __iomem *addr,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h
index c0b77fe1a696..ae9b5db53d7f 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h
@@ -42,6 +42,10 @@ struct dpu_hw_dsc_ops {
 	 */
 	void (*dsc_config_thresh)(struct dpu_hw_dsc *hw_dsc,
 				  struct drm_dsc_config *dsc);
+
+	void (*dsc_bind_pingpong_blk)(struct dpu_hw_dsc *hw_dsc,
+				  bool enable,
+				  enum dpu_pingpong pp);
 };
 
 struct dpu_hw_dsc {
-- 
2.39.0


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

* [PATCH v2 8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
  2022-12-21 23:19 ` Marijn Suijten
@ 2022-12-21 23:19   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Marijn Suijten, Vinod Polimera,
	Haowen Bai, Sam Ravnborg, Kuogee Hsieh, Jessica Zhang,
	Jani Nikula, linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

These DSC blocks on CTL V1 need to set its corresponding PINGPONG block
index in a hardware register to configure where to send pixel output to,
via the newly-added DPU_DSC_OUTPUT_CTRL feature flag.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 318f0b4dbf6e..114ad8ca4554 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -1566,18 +1566,25 @@ static const struct dpu_merge_3d_cfg sm8150_merge_3d[] = {
 /*************************************************************
  * DSC sub blocks config
  *************************************************************/
-#define DSC_BLK(_name, _id, _base) \
+#define DSC_BLK(_name, _id, _base, _features) \
 	{\
 	.name = _name, .id = _id, \
 	.base = _base, .len = 0x140, \
-	.features = 0, \
+	.features = _features, \
 	}
 
 static struct dpu_dsc_cfg sdm845_dsc[] = {
-	DSC_BLK("dsc_0", DSC_0, 0x80000),
-	DSC_BLK("dsc_1", DSC_1, 0x80400),
-	DSC_BLK("dsc_2", DSC_2, 0x80800),
-	DSC_BLK("dsc_3", DSC_3, 0x80c00),
+	DSC_BLK("dsc_0", DSC_0, 0x80000, 0),
+	DSC_BLK("dsc_1", DSC_1, 0x80400, 0),
+	DSC_BLK("dsc_2", DSC_2, 0x80800, 0),
+	DSC_BLK("dsc_3", DSC_3, 0x80c00, 0),
+};
+
+static struct dpu_dsc_cfg sm8150_dsc[] = {
+	DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)),
+	DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)),
+	DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)),
+	DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)),
 };
 
 /*************************************************************
@@ -2474,6 +2481,8 @@ static const struct dpu_mdss_cfg sm8150_dpu_cfg = {
 	.mixer = sm8150_lm,
 	.dspp_count = ARRAY_SIZE(sm8150_dspp),
 	.dspp = sm8150_dspp,
+	.dsc_count = ARRAY_SIZE(sm8150_dsc),
+	.dsc = sm8150_dsc,
 	.pingpong_count = ARRAY_SIZE(sm8150_pp),
 	.pingpong = sm8150_pp,
 	.merge_3d_count = ARRAY_SIZE(sm8150_merge_3d),
@@ -2524,6 +2533,8 @@ static const struct dpu_mdss_cfg sm8250_dpu_cfg = {
 	.mixer = sm8150_lm,
 	.dspp_count = ARRAY_SIZE(sm8150_dspp),
 	.dspp = sm8150_dspp,
+	.dsc_count = ARRAY_SIZE(sm8150_dsc),
+	.dsc = sm8150_dsc,
 	.pingpong_count = ARRAY_SIZE(sm8150_pp),
 	.pingpong = sm8150_pp,
 	.merge_3d_count = ARRAY_SIZE(sm8150_merge_3d),
-- 
2.39.0


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

* [PATCH v2 8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
@ 2022-12-21 23:19   ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2022-12-21 23:19 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Marijn Suijten,
	Sean Paul, David Airlie, Daniel Vetter, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

These DSC blocks on CTL V1 need to set its corresponding PINGPONG block
index in a hardware register to configure where to send pixel output to,
via the newly-added DPU_DSC_OUTPUT_CTRL feature flag.

Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
---
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    | 23 ++++++++++++++-----
 1 file changed, 17 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index 318f0b4dbf6e..114ad8ca4554 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -1566,18 +1566,25 @@ static const struct dpu_merge_3d_cfg sm8150_merge_3d[] = {
 /*************************************************************
  * DSC sub blocks config
  *************************************************************/
-#define DSC_BLK(_name, _id, _base) \
+#define DSC_BLK(_name, _id, _base, _features) \
 	{\
 	.name = _name, .id = _id, \
 	.base = _base, .len = 0x140, \
-	.features = 0, \
+	.features = _features, \
 	}
 
 static struct dpu_dsc_cfg sdm845_dsc[] = {
-	DSC_BLK("dsc_0", DSC_0, 0x80000),
-	DSC_BLK("dsc_1", DSC_1, 0x80400),
-	DSC_BLK("dsc_2", DSC_2, 0x80800),
-	DSC_BLK("dsc_3", DSC_3, 0x80c00),
+	DSC_BLK("dsc_0", DSC_0, 0x80000, 0),
+	DSC_BLK("dsc_1", DSC_1, 0x80400, 0),
+	DSC_BLK("dsc_2", DSC_2, 0x80800, 0),
+	DSC_BLK("dsc_3", DSC_3, 0x80c00, 0),
+};
+
+static struct dpu_dsc_cfg sm8150_dsc[] = {
+	DSC_BLK("dsc_0", DSC_0, 0x80000, BIT(DPU_DSC_OUTPUT_CTRL)),
+	DSC_BLK("dsc_1", DSC_1, 0x80400, BIT(DPU_DSC_OUTPUT_CTRL)),
+	DSC_BLK("dsc_2", DSC_2, 0x80800, BIT(DPU_DSC_OUTPUT_CTRL)),
+	DSC_BLK("dsc_3", DSC_3, 0x80c00, BIT(DPU_DSC_OUTPUT_CTRL)),
 };
 
 /*************************************************************
@@ -2474,6 +2481,8 @@ static const struct dpu_mdss_cfg sm8150_dpu_cfg = {
 	.mixer = sm8150_lm,
 	.dspp_count = ARRAY_SIZE(sm8150_dspp),
 	.dspp = sm8150_dspp,
+	.dsc_count = ARRAY_SIZE(sm8150_dsc),
+	.dsc = sm8150_dsc,
 	.pingpong_count = ARRAY_SIZE(sm8150_pp),
 	.pingpong = sm8150_pp,
 	.merge_3d_count = ARRAY_SIZE(sm8150_merge_3d),
@@ -2524,6 +2533,8 @@ static const struct dpu_mdss_cfg sm8250_dpu_cfg = {
 	.mixer = sm8150_lm,
 	.dspp_count = ARRAY_SIZE(sm8150_dspp),
 	.dspp = sm8150_dspp,
+	.dsc_count = ARRAY_SIZE(sm8150_dsc),
+	.dsc = sm8150_dsc,
 	.pingpong_count = ARRAY_SIZE(sm8150_pp),
 	.pingpong = sm8150_pp,
 	.merge_3d_count = ARRAY_SIZE(sm8150_merge_3d),
-- 
2.39.0


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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
  2022-12-21 23:19 ` Marijn Suijten
@ 2023-01-05 14:49   ` Daniel Vetter
  -1 siblings, 0 replies; 47+ messages in thread
From: Daniel Vetter @ 2023-01-05 14:49 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Dmitry Baryshkov, freedreno,
	Vinod Polimera

On Thu, Dec 22, 2022 at 12:19:35AM +0100, Marijn Suijten wrote:
> This preliminary Display Stream Compression support package for
> (initially tested on) sm8[12]50 is based on comparing DSC behaviour
> between downstream and mainline.  Some new callbacks are added (for
> binding blocks on active CTLs), logic bugs are corrected, zeroed struct
> members are now assigned proper values, and RM allocation and hw block
> retrieval now hand out (or not) DSC blocks without causing null-pointer
> dereferences.
> 
> Unfortunately it is not yet enough to get rid of completely corrupted
> display output on the boards I tested here:
> - Sony Xperia 1 (sm8150), 1644x3840 or 1096x2560 pixels;
> - Sony Xperia 5II (sm8250), 1080x2520, at 60 or 120Hz;
> - (can include more Xperia boards if desired)
> 
> Both devices use the DUALPIPE_DSCMERGE topology downstream: dual LM, PP
> and DSC, but only a single INTF/encoder/DSI-link.
> 
> Hopefully this spawns some community/upstream interest to help rootcause
> our corruption issues (after we open a drm/msm report on GitLab for more
> appropriate tracking).
> 
> The Sony Xperia XZ3 (sdm845) was fully tested and validated with this
> series to not cause any regressions (and one of the math fixes now
> allows us to change slice_count in the panel driver, which would corrupt
> previously).
> 
> Changes since v1:
> 
> - Split patch 6 into two separately backportable Fixes: patches;
> - Additionally remove num_enc from msm_display_topology in favour of
>   num_dsc;
> - Reorder patches to have all Fixes: at the beginning for easier
>   picking;
> - Fix existing multiline comment while editing it anyway;
> - Add missing Signed-off-by to patch 5.

Please note that Electric Boogaloo/Boogaloo Boys has been appropriated by
US alt-right groups, and so is really not a great thing to put into the
cover letter for your patch series. For the next round, please use a meme
that isn't tarnished like this.

Thanks, Daniel


> 
> v1: https://lore.kernel.org/linux-arm-msm/20221213232207.113607-1-marijn.suijten@somainline.org/T/#u
> 
> Marijn Suijten (8):
>   drm/msm/dpu: Wire up DSC mask for active CTL configuration
>   drm/msm/dsi: Use DSC slice(s) packet size to compute word count
>   drm/msm/dsi: Flip greater-than check for slice_count and
>     slice_per_intf
>   drm/msm/dpu: Disallow unallocated resources to be returned
>   drm/msm/dpu: Reject topologies for which no DSC blocks are available
>   drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
>   drm/msm/dpu: Implement DSC binding to PP block for CTL V1
>   drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
> 
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 12 +++++----
>  .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c  |  1 +
>  .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |  1 +
>  .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    | 23 +++++++++++-----
>  .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  9 +++++++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c    | 27 +++++++++++++++++++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h    |  4 +++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c        | 14 ++++++++--
>  drivers/gpu/drm/msm/dsi/dsi_host.c            |  7 ++---
>  drivers/gpu/drm/msm/msm_drv.h                 |  2 --
>  10 files changed, 82 insertions(+), 18 deletions(-)
> 
> --
> 2.39.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2023-01-05 14:49   ` Daniel Vetter
  0 siblings, 0 replies; 47+ messages in thread
From: Daniel Vetter @ 2023-01-05 14:49 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov,
	Vinod Koul, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Konrad Dybcio, Martin Botka,
	Jami Kettunen, Sean Paul, David Airlie, Daniel Vetter,
	Stephen Boyd, Bjorn Andersson, Jessica Zhang,
	Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On Thu, Dec 22, 2022 at 12:19:35AM +0100, Marijn Suijten wrote:
> This preliminary Display Stream Compression support package for
> (initially tested on) sm8[12]50 is based on comparing DSC behaviour
> between downstream and mainline.  Some new callbacks are added (for
> binding blocks on active CTLs), logic bugs are corrected, zeroed struct
> members are now assigned proper values, and RM allocation and hw block
> retrieval now hand out (or not) DSC blocks without causing null-pointer
> dereferences.
> 
> Unfortunately it is not yet enough to get rid of completely corrupted
> display output on the boards I tested here:
> - Sony Xperia 1 (sm8150), 1644x3840 or 1096x2560 pixels;
> - Sony Xperia 5II (sm8250), 1080x2520, at 60 or 120Hz;
> - (can include more Xperia boards if desired)
> 
> Both devices use the DUALPIPE_DSCMERGE topology downstream: dual LM, PP
> and DSC, but only a single INTF/encoder/DSI-link.
> 
> Hopefully this spawns some community/upstream interest to help rootcause
> our corruption issues (after we open a drm/msm report on GitLab for more
> appropriate tracking).
> 
> The Sony Xperia XZ3 (sdm845) was fully tested and validated with this
> series to not cause any regressions (and one of the math fixes now
> allows us to change slice_count in the panel driver, which would corrupt
> previously).
> 
> Changes since v1:
> 
> - Split patch 6 into two separately backportable Fixes: patches;
> - Additionally remove num_enc from msm_display_topology in favour of
>   num_dsc;
> - Reorder patches to have all Fixes: at the beginning for easier
>   picking;
> - Fix existing multiline comment while editing it anyway;
> - Add missing Signed-off-by to patch 5.

Please note that Electric Boogaloo/Boogaloo Boys has been appropriated by
US alt-right groups, and so is really not a great thing to put into the
cover letter for your patch series. For the next round, please use a meme
that isn't tarnished like this.

Thanks, Daniel


> 
> v1: https://lore.kernel.org/linux-arm-msm/20221213232207.113607-1-marijn.suijten@somainline.org/T/#u
> 
> Marijn Suijten (8):
>   drm/msm/dpu: Wire up DSC mask for active CTL configuration
>   drm/msm/dsi: Use DSC slice(s) packet size to compute word count
>   drm/msm/dsi: Flip greater-than check for slice_count and
>     slice_per_intf
>   drm/msm/dpu: Disallow unallocated resources to be returned
>   drm/msm/dpu: Reject topologies for which no DSC blocks are available
>   drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
>   drm/msm/dpu: Implement DSC binding to PP block for CTL V1
>   drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
> 
>  drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 12 +++++----
>  .../drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c  |  1 +
>  .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |  1 +
>  .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    | 23 +++++++++++-----
>  .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  9 +++++++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c    | 27 +++++++++++++++++++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.h    |  4 +++
>  drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c        | 14 ++++++++--
>  drivers/gpu/drm/msm/dsi/dsi_host.c            |  7 ++---
>  drivers/gpu/drm/msm/msm_drv.h                 |  2 --
>  10 files changed, 82 insertions(+), 18 deletions(-)
> 
> --
> 2.39.0
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

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

* Re: [PATCH v2 1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
  2022-12-21 23:19   ` Marijn Suijten
@ 2023-01-08 23:23     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:23 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On 22/12/2022 01:19, Marijn Suijten wrote:
> Active CTLs have to configure what DSC block(s) have to be enabled, and
> what DSC block(s) have to be flushed; this value was initialized to zero
> resulting in the necessary register writes to never happen (or would
> write zero otherwise).  This seems to have gotten lost in the DSC v4->v5
> series while refactoring how the combination with merge_3d was handled.
> 
> Fixes: 58dca9810749 ("drm/msm/disp/dpu1: Add support for DSC in encoder")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 +
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 +
>   2 files changed, 2 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
@ 2023-01-08 23:23     ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:23 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

On 22/12/2022 01:19, Marijn Suijten wrote:
> Active CTLs have to configure what DSC block(s) have to be enabled, and
> what DSC block(s) have to be flushed; this value was initialized to zero
> resulting in the necessary register writes to never happen (or would
> write zero otherwise).  This seems to have gotten lost in the DSC v4->v5
> series while refactoring how the combination with merge_3d was handled.
> 
> Fixes: 58dca9810749 ("drm/msm/disp/dpu1: Add support for DSC in encoder")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_cmd.c | 1 +
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_vid.c | 1 +
>   2 files changed, 2 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>


-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2022-12-21 23:19   ` Marijn Suijten
@ 2023-01-08 23:28     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:28 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

On 22/12/2022 01:19, Marijn Suijten wrote:
> In the event that the topology requests resources that have not been
> created by the system (because they are typically not represented in
> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> blocks) remain NULL but will still be returned out of
> dpu_rm_get_assigned_resources, where the caller expects to get an array
> containing num_blks valid pointers (but instead gets these NULLs).
> 
> To prevent this from happening, where null-pointer dereferences
> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> increase past NULL blocks and will print an error and break instead.
> After all, max_blks represents the static size of the maximum number of
> blocks whereas the actual amount varies per platform.
> 
> ^1: which can happen after a git rebase ended up moving additions to
> _dpu_cfg to a different struct which has the same patch context.
> 
> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>   1 file changed, 5 insertions(+)

I think the patch is not fully correct. Please check resource 
availability during allocation. I wouldn't expect an error from 
get_assigned_resources because of resource exhaustion.

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2023-01-08 23:28     ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:28 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno

On 22/12/2022 01:19, Marijn Suijten wrote:
> In the event that the topology requests resources that have not been
> created by the system (because they are typically not represented in
> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> blocks) remain NULL but will still be returned out of
> dpu_rm_get_assigned_resources, where the caller expects to get an array
> containing num_blks valid pointers (but instead gets these NULLs).
> 
> To prevent this from happening, where null-pointer dereferences
> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> increase past NULL blocks and will print an error and break instead.
> After all, max_blks represents the static size of the maximum number of
> blocks whereas the actual amount varies per platform.
> 
> ^1: which can happen after a git rebase ended up moving additions to
> _dpu_cfg to a different struct which has the same patch context.
> 
> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>   1 file changed, 5 insertions(+)

I think the patch is not fully correct. Please check resource 
availability during allocation. I wouldn't expect an error from 
get_assigned_resources because of resource exhaustion.

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
  2022-12-21 23:19   ` Marijn Suijten
@ 2023-01-08 23:29     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:29 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On 22/12/2022 01:19, Marijn Suijten wrote:
> Resource allocation of DSC blocks should behave more like LMs and CTLs
> where NULL resources (based on initial hw_blk creation via definitions
> in the catalog) are skipped ^1.  The current hardcoded mapping of DSC
> blocks however means that resource allocation shouldn't succeed at all
> when the DSC block on the corresponding index doesn't exist, rather than
> searching for the next free block.
> 
> This hardcoded mapping should be loosened separately as DPU 5.0.0
> introduced a crossbar where DSC blocks can be "somewhat" freely bound to
> any PP and CTL (in proper pairs).
> 
> ^1: which, on hardware that supports DSC, can happen after a git rebase
> ended up moving additions to _dpu_cfg to a different struct which has
> the same patch context.
> 
> Fixes: f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>   1 file changed, 5 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
@ 2023-01-08 23:29     ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:29 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

On 22/12/2022 01:19, Marijn Suijten wrote:
> Resource allocation of DSC blocks should behave more like LMs and CTLs
> where NULL resources (based on initial hw_blk creation via definitions
> in the catalog) are skipped ^1.  The current hardcoded mapping of DSC
> blocks however means that resource allocation shouldn't succeed at all
> when the DSC block on the corresponding index doesn't exist, rather than
> searching for the next free block.
> 
> This hardcoded mapping should be loosened separately as DPU 5.0.0
> introduced a crossbar where DSC blocks can be "somewhat" freely bound to
> any PP and CTL (in proper pairs).
> 
> ^1: which, on hardware that supports DSC, can happen after a git rebase
> ended up moving additions to _dpu_cfg to a different struct which has
> the same patch context.
> 
> Fixes: f2803ee91a41 ("drm/msm/disp/dpu1: Add DSC support in RM")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>   1 file changed, 5 insertions(+)

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2023-01-08 23:28     ` Dmitry Baryshkov
@ 2023-01-08 23:30       ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:30 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> On 22/12/2022 01:19, Marijn Suijten wrote:
>> In the event that the topology requests resources that have not been
>> created by the system (because they are typically not represented in
>> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
>> blocks) remain NULL but will still be returned out of
>> dpu_rm_get_assigned_resources, where the caller expects to get an array
>> containing num_blks valid pointers (but instead gets these NULLs).
>>
>> To prevent this from happening, where null-pointer dereferences
>> typically result in a hard-to-debug platform lockup, num_blks shouldn't
>> increase past NULL blocks and will print an error and break instead.
>> After all, max_blks represents the static size of the maximum number of
>> blocks whereas the actual amount varies per platform.
>>
>> ^1: which can happen after a git rebase ended up moving additions to
>> _dpu_cfg to a different struct which has the same patch context.
>>
>> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
>> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
>> ---
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>>   1 file changed, 5 insertions(+)
> 
> I think the patch is not fully correct. Please check resource 
> availability during allocation. I wouldn't expect an error from 
> get_assigned_resources because of resource exhaustion.
> 

Another option, since allocation functions (except DSC) already have 
these safety checks: check error message to mention internal 
inconstency: allocated resource doesn't exist.

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2023-01-08 23:30       ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:30 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno

On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> On 22/12/2022 01:19, Marijn Suijten wrote:
>> In the event that the topology requests resources that have not been
>> created by the system (because they are typically not represented in
>> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
>> blocks) remain NULL but will still be returned out of
>> dpu_rm_get_assigned_resources, where the caller expects to get an array
>> containing num_blks valid pointers (but instead gets these NULLs).
>>
>> To prevent this from happening, where null-pointer dereferences
>> typically result in a hard-to-debug platform lockup, num_blks shouldn't
>> increase past NULL blocks and will print an error and break instead.
>> After all, max_blks represents the static size of the maximum number of
>> blocks whereas the actual amount varies per platform.
>>
>> ^1: which can happen after a git rebase ended up moving additions to
>> _dpu_cfg to a different struct which has the same patch context.
>>
>> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
>> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
>> ---
>>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>>   1 file changed, 5 insertions(+)
> 
> I think the patch is not fully correct. Please check resource 
> availability during allocation. I wouldn't expect an error from 
> get_assigned_resources because of resource exhaustion.
> 

Another option, since allocation functions (except DSC) already have 
these safety checks: check error message to mention internal 
inconstency: allocated resource doesn't exist.

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
  2022-12-21 23:19   ` Marijn Suijten
@ 2023-01-08 23:31     ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:31 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On 22/12/2022 01:19, Marijn Suijten wrote:
> Downstream calls this num_enc yet the DSC patches introduced a new
> num_dsc struct member, leaving num_enc effectively unused.
> 
> Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
>   drivers/gpu/drm/msm/msm_drv.h               | 2 --
>   3 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 9c6817b5a194..a158cd502d38 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
>   			topology.num_dspp = topology.num_lm;
>   	}
>   
> -	topology.num_enc = 0;
>   	topology.num_intf = intf_count;
>   
>   	if (dpu_enc->dsc) {
> -		/* In case of Display Stream Compression (DSC), we would use
> -		 * 2 encoders, 2 layer mixers and 1 interface
> +		/*
> +		 * In case of Display Stream Compression (DSC), we would use
> +		 * 2 DSC encoders, 2 layer mixers and 1 interface
>   		 * this is power optimal and can drive up to (including) 4k
>   		 * screens
>   		 */
> -		topology.num_enc = 2;
>   		topology.num_dsc = 2;
> -		topology.num_intf = 1;
>   		topology.num_lm = 2;
> +		topology.num_intf = 1;

Unless there is a reason, please move num_intf assignment back while 
preparing v3.

With that fixed:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

>   	}
>   
>   	return topology;
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> index dcbf03d2940a..5e7aa0f3a31c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> @@ -548,8 +548,8 @@ static int _dpu_rm_populate_requirements(
>   {
>   	reqs->topology = req_topology;
>   
> -	DRM_DEBUG_KMS("num_lm: %d num_enc: %d num_intf: %d\n",
> -		      reqs->topology.num_lm, reqs->topology.num_enc,
> +	DRM_DEBUG_KMS("num_lm: %d num_dsc: %d num_intf: %d\n",
> +		      reqs->topology.num_lm, reqs->topology.num_dsc,
>   		      reqs->topology.num_intf);
>   
>   	return 0;
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index d4e0ef608950..74626a271f46 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -82,14 +82,12 @@ enum msm_event_wait {
>   /**
>    * struct msm_display_topology - defines a display topology pipeline
>    * @num_lm:       number of layer mixers used
> - * @num_enc:      number of compression encoder blocks used
>    * @num_intf:     number of interfaces the panel is mounted on
>    * @num_dspp:     number of dspp blocks used
>    * @num_dsc:      number of Display Stream Compression (DSC) blocks used
>    */
>   struct msm_display_topology {
>   	u32 num_lm;
> -	u32 num_enc;
>   	u32 num_intf;
>   	u32 num_dspp;
>   	u32 num_dsc;

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
@ 2023-01-08 23:31     ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-08 23:31 UTC (permalink / raw)
  To: Marijn Suijten, phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno

On 22/12/2022 01:19, Marijn Suijten wrote:
> Downstream calls this num_enc yet the DSC patches introduced a new
> num_dsc struct member, leaving num_enc effectively unused.
> 
> Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
>   drivers/gpu/drm/msm/msm_drv.h               | 2 --
>   3 files changed, 6 insertions(+), 9 deletions(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index 9c6817b5a194..a158cd502d38 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
>   			topology.num_dspp = topology.num_lm;
>   	}
>   
> -	topology.num_enc = 0;
>   	topology.num_intf = intf_count;
>   
>   	if (dpu_enc->dsc) {
> -		/* In case of Display Stream Compression (DSC), we would use
> -		 * 2 encoders, 2 layer mixers and 1 interface
> +		/*
> +		 * In case of Display Stream Compression (DSC), we would use
> +		 * 2 DSC encoders, 2 layer mixers and 1 interface
>   		 * this is power optimal and can drive up to (including) 4k
>   		 * screens
>   		 */
> -		topology.num_enc = 2;
>   		topology.num_dsc = 2;
> -		topology.num_intf = 1;
>   		topology.num_lm = 2;
> +		topology.num_intf = 1;

Unless there is a reason, please move num_intf assignment back while 
preparing v3.

With that fixed:

Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

>   	}
>   
>   	return topology;
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> index dcbf03d2940a..5e7aa0f3a31c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
> @@ -548,8 +548,8 @@ static int _dpu_rm_populate_requirements(
>   {
>   	reqs->topology = req_topology;
>   
> -	DRM_DEBUG_KMS("num_lm: %d num_enc: %d num_intf: %d\n",
> -		      reqs->topology.num_lm, reqs->topology.num_enc,
> +	DRM_DEBUG_KMS("num_lm: %d num_dsc: %d num_intf: %d\n",
> +		      reqs->topology.num_lm, reqs->topology.num_dsc,
>   		      reqs->topology.num_intf);
>   
>   	return 0;
> diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
> index d4e0ef608950..74626a271f46 100644
> --- a/drivers/gpu/drm/msm/msm_drv.h
> +++ b/drivers/gpu/drm/msm/msm_drv.h
> @@ -82,14 +82,12 @@ enum msm_event_wait {
>   /**
>    * struct msm_display_topology - defines a display topology pipeline
>    * @num_lm:       number of layer mixers used
> - * @num_enc:      number of compression encoder blocks used
>    * @num_intf:     number of interfaces the panel is mounted on
>    * @num_dspp:     number of dspp blocks used
>    * @num_dsc:      number of Display Stream Compression (DSC) blocks used
>    */
>   struct msm_display_topology {
>   	u32 num_lm;
> -	u32 num_enc;
>   	u32 num_intf;
>   	u32 num_dspp;
>   	u32 num_dsc;

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
  2023-01-05 14:49   ` Daniel Vetter
  (?)
@ 2023-01-09  7:59   ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09  7:59 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Dmitry Baryshkov,
	Vinod Koul, ~postmarketos/upstreaming,
	AngeloGioacchino Del Regno, Konrad Dybcio, Martin Botka,
	Jami Kettunen, Sean Paul, David Airlie, Stephen Boyd,
	Bjorn Andersson, Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On 2023-01-05 15:49:58, Daniel Vetter wrote:
> On Thu, Dec 22, 2022 at 12:19:35AM +0100, Marijn Suijten wrote:
> > [..]
> 
> Please note that Electric Boogaloo/Boogaloo Boys has been appropriated by
> US alt-right groups, and so is really not a great thing to put into the
> cover letter for your patch series. For the next round, please use a meme
> that isn't tarnished like this.

Apologies for that, I wasn't aware of this abuse as a non-US citizen and
hope this series is not offending anyone.

As far as I recall this series was set to be applied for 6.3 yet Dmitry
seems to have just posted some additional comments.  May have been
confusion on my end.

Hence we do now need another cheeky title, conveying that we're already
on the second round of fixes for DSC and it is still not working on
major SoCs/boards.

- Marijn


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

* Re: [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
  2023-01-08 23:31     ` Dmitry Baryshkov
@ 2023-01-09  8:21       ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09  8:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno, Vinod Polimera

On 2023-01-09 01:31:57, Dmitry Baryshkov wrote:
> On 22/12/2022 01:19, Marijn Suijten wrote:
> > Downstream calls this num_enc yet the DSC patches introduced a new
> > num_dsc struct member, leaving num_enc effectively unused.
> > 
> > Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > ---
> >   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
> >   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
> >   drivers/gpu/drm/msm/msm_drv.h               | 2 --
> >   3 files changed, 6 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > index 9c6817b5a194..a158cd502d38 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > @@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
> >   			topology.num_dspp = topology.num_lm;
> >   	}
> >   
> > -	topology.num_enc = 0;
> >   	topology.num_intf = intf_count;
> >   
> >   	if (dpu_enc->dsc) {
> > -		/* In case of Display Stream Compression (DSC), we would use
> > -		 * 2 encoders, 2 layer mixers and 1 interface
> > +		/*
> > +		 * In case of Display Stream Compression (DSC), we would use
> > +		 * 2 DSC encoders, 2 layer mixers and 1 interface
> >   		 * this is power optimal and can drive up to (including) 4k
> >   		 * screens
> >   		 */
> > -		topology.num_enc = 2;
> >   		topology.num_dsc = 2;
> > -		topology.num_intf = 1;
> >   		topology.num_lm = 2;
> > +		topology.num_intf = 1;
> 
> Unless there is a reason, please move num_intf assignment back while 
> preparing v3.

The assignment was reordered to match the order described in the comment
right above, such that this reads more naturally.  Not sure if it's
worth sending that as a separate fix, or drop it entirely.

> With that fixed:
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

<snip>

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

* Re: [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
@ 2023-01-09  8:21       ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09  8:21 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On 2023-01-09 01:31:57, Dmitry Baryshkov wrote:
> On 22/12/2022 01:19, Marijn Suijten wrote:
> > Downstream calls this num_enc yet the DSC patches introduced a new
> > num_dsc struct member, leaving num_enc effectively unused.
> > 
> > Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
> > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > ---
> >   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
> >   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
> >   drivers/gpu/drm/msm/msm_drv.h               | 2 --
> >   3 files changed, 6 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > index 9c6817b5a194..a158cd502d38 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > @@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
> >   			topology.num_dspp = topology.num_lm;
> >   	}
> >   
> > -	topology.num_enc = 0;
> >   	topology.num_intf = intf_count;
> >   
> >   	if (dpu_enc->dsc) {
> > -		/* In case of Display Stream Compression (DSC), we would use
> > -		 * 2 encoders, 2 layer mixers and 1 interface
> > +		/*
> > +		 * In case of Display Stream Compression (DSC), we would use
> > +		 * 2 DSC encoders, 2 layer mixers and 1 interface
> >   		 * this is power optimal and can drive up to (including) 4k
> >   		 * screens
> >   		 */
> > -		topology.num_enc = 2;
> >   		topology.num_dsc = 2;
> > -		topology.num_intf = 1;
> >   		topology.num_lm = 2;
> > +		topology.num_intf = 1;
> 
> Unless there is a reason, please move num_intf assignment back while 
> preparing v3.

The assignment was reordered to match the order described in the comment
right above, such that this reads more naturally.  Not sure if it's
worth sending that as a separate fix, or drop it entirely.

> With that fixed:
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

<snip>

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2023-01-08 23:30       ` Dmitry Baryshkov
@ 2023-01-09  8:23         ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09  8:23 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno,
	Vinod Polimera

On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
> On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> > On 22/12/2022 01:19, Marijn Suijten wrote:
> >> In the event that the topology requests resources that have not been
> >> created by the system (because they are typically not represented in
> >> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> >> blocks) remain NULL but will still be returned out of
> >> dpu_rm_get_assigned_resources, where the caller expects to get an array
> >> containing num_blks valid pointers (but instead gets these NULLs).
> >>
> >> To prevent this from happening, where null-pointer dereferences
> >> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> >> increase past NULL blocks and will print an error and break instead.
> >> After all, max_blks represents the static size of the maximum number of
> >> blocks whereas the actual amount varies per platform.
> >>
> >> ^1: which can happen after a git rebase ended up moving additions to
> >> _dpu_cfg to a different struct which has the same patch context.
> >>
> >> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> >> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> >> ---
> >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
> >>   1 file changed, 5 insertions(+)
> > 
> > I think the patch is not fully correct. Please check resource 
> > availability during allocation. I wouldn't expect an error from 
> > get_assigned_resources because of resource exhaustion.

Theoretically patch 5/8 should take care of this, and we should never
reach this failure condition.  Emphasis on /should/, this may happen
again if/when another block type is added with sub-par resource
allocation and assignment implementation.

> Another option, since allocation functions (except DSC) already have 
> these safety checks: check error message to mention internal 
> inconstency: allocated resource doesn't exist.

Is this a suggestion for the wording of the error message?

- Marijn

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2023-01-09  8:23         ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09  8:23 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
> On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> > On 22/12/2022 01:19, Marijn Suijten wrote:
> >> In the event that the topology requests resources that have not been
> >> created by the system (because they are typically not represented in
> >> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> >> blocks) remain NULL but will still be returned out of
> >> dpu_rm_get_assigned_resources, where the caller expects to get an array
> >> containing num_blks valid pointers (but instead gets these NULLs).
> >>
> >> To prevent this from happening, where null-pointer dereferences
> >> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> >> increase past NULL blocks and will print an error and break instead.
> >> After all, max_blks represents the static size of the maximum number of
> >> blocks whereas the actual amount varies per platform.
> >>
> >> ^1: which can happen after a git rebase ended up moving additions to
> >> _dpu_cfg to a different struct which has the same patch context.
> >>
> >> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> >> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> >> ---
> >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
> >>   1 file changed, 5 insertions(+)
> > 
> > I think the patch is not fully correct. Please check resource 
> > availability during allocation. I wouldn't expect an error from 
> > get_assigned_resources because of resource exhaustion.

Theoretically patch 5/8 should take care of this, and we should never
reach this failure condition.  Emphasis on /should/, this may happen
again if/when another block type is added with sub-par resource
allocation and assignment implementation.

> Another option, since allocation functions (except DSC) already have 
> these safety checks: check error message to mention internal 
> inconstency: allocated resource doesn't exist.

Is this a suggestion for the wording of the error message?

- Marijn

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2023-01-09  8:23         ` Marijn Suijten
@ 2023-01-09  9:06           ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09  9:06 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno,
	Vinod Polimera

On Mon, 9 Jan 2023 at 10:24, Marijn Suijten
<marijn.suijten@somainline.org> wrote:
>
> On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
> > On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> > > On 22/12/2022 01:19, Marijn Suijten wrote:
> > >> In the event that the topology requests resources that have not been
> > >> created by the system (because they are typically not represented in
> > >> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> > >> blocks) remain NULL but will still be returned out of
> > >> dpu_rm_get_assigned_resources, where the caller expects to get an array
> > >> containing num_blks valid pointers (but instead gets these NULLs).
> > >>
> > >> To prevent this from happening, where null-pointer dereferences
> > >> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> > >> increase past NULL blocks and will print an error and break instead.
> > >> After all, max_blks represents the static size of the maximum number of
> > >> blocks whereas the actual amount varies per platform.
> > >>
> > >> ^1: which can happen after a git rebase ended up moving additions to
> > >> _dpu_cfg to a different struct which has the same patch context.
> > >>
> > >> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> > >> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > >> ---
> > >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
> > >>   1 file changed, 5 insertions(+)
> > >
> > > I think the patch is not fully correct. Please check resource
> > > availability during allocation. I wouldn't expect an error from
> > > get_assigned_resources because of resource exhaustion.
>
> Theoretically patch 5/8 should take care of this, and we should never
> reach this failure condition.  Emphasis on /should/, this may happen
> again if/when another block type is added with sub-par resource
> allocation and assignment implementation.

Yeah. Maybe swapping 4/8 and 5/8 makes sense.

>
> > Another option, since allocation functions (except DSC) already have
> > these safety checks: check error message to mention internal
> > inconstency: allocated resource doesn't exist.
>
> Is this a suggestion for the wording of the error message?

Yes. Because the current message makes one think that it is output
during allocation / assignment to encoder, while this is a safety net.

>
> - Marijn




--
With best wishes
Dmitry

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2023-01-09  9:06           ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09  9:06 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

On Mon, 9 Jan 2023 at 10:24, Marijn Suijten
<marijn.suijten@somainline.org> wrote:
>
> On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
> > On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> > > On 22/12/2022 01:19, Marijn Suijten wrote:
> > >> In the event that the topology requests resources that have not been
> > >> created by the system (because they are typically not represented in
> > >> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> > >> blocks) remain NULL but will still be returned out of
> > >> dpu_rm_get_assigned_resources, where the caller expects to get an array
> > >> containing num_blks valid pointers (but instead gets these NULLs).
> > >>
> > >> To prevent this from happening, where null-pointer dereferences
> > >> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> > >> increase past NULL blocks and will print an error and break instead.
> > >> After all, max_blks represents the static size of the maximum number of
> > >> blocks whereas the actual amount varies per platform.
> > >>
> > >> ^1: which can happen after a git rebase ended up moving additions to
> > >> _dpu_cfg to a different struct which has the same patch context.
> > >>
> > >> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> > >> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > >> ---
> > >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
> > >>   1 file changed, 5 insertions(+)
> > >
> > > I think the patch is not fully correct. Please check resource
> > > availability during allocation. I wouldn't expect an error from
> > > get_assigned_resources because of resource exhaustion.
>
> Theoretically patch 5/8 should take care of this, and we should never
> reach this failure condition.  Emphasis on /should/, this may happen
> again if/when another block type is added with sub-par resource
> allocation and assignment implementation.

Yeah. Maybe swapping 4/8 and 5/8 makes sense.

>
> > Another option, since allocation functions (except DSC) already have
> > these safety checks: check error message to mention internal
> > inconstency: allocated resource doesn't exist.
>
> Is this a suggestion for the wording of the error message?

Yes. Because the current message makes one think that it is output
during allocation / assignment to encoder, while this is a safety net.

>
> - Marijn




--
With best wishes
Dmitry

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

* Re: [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
  2023-01-09  8:21       ` Marijn Suijten
@ 2023-01-09  9:08         ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09  9:08 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno, Vinod Polimera

On Mon, 9 Jan 2023 at 10:21, Marijn Suijten
<marijn.suijten@somainline.org> wrote:
>
> On 2023-01-09 01:31:57, Dmitry Baryshkov wrote:
> > On 22/12/2022 01:19, Marijn Suijten wrote:
> > > Downstream calls this num_enc yet the DSC patches introduced a new
> > > num_dsc struct member, leaving num_enc effectively unused.
> > >
> > > Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
> > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > > ---
> > >   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
> > >   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
> > >   drivers/gpu/drm/msm/msm_drv.h               | 2 --
> > >   3 files changed, 6 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > index 9c6817b5a194..a158cd502d38 100644
> > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > @@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
> > >                     topology.num_dspp = topology.num_lm;
> > >     }
> > >
> > > -   topology.num_enc = 0;
> > >     topology.num_intf = intf_count;
> > >
> > >     if (dpu_enc->dsc) {
> > > -           /* In case of Display Stream Compression (DSC), we would use
> > > -            * 2 encoders, 2 layer mixers and 1 interface
> > > +           /*
> > > +            * In case of Display Stream Compression (DSC), we would use
> > > +            * 2 DSC encoders, 2 layer mixers and 1 interface
> > >              * this is power optimal and can drive up to (including) 4k
> > >              * screens
> > >              */
> > > -           topology.num_enc = 2;
> > >             topology.num_dsc = 2;
> > > -           topology.num_intf = 1;
> > >             topology.num_lm = 2;
> > > +           topology.num_intf = 1;
> >
> > Unless there is a reason, please move num_intf assignment back while
> > preparing v3.
>
> The assignment was reordered to match the order described in the comment
> right above, such that this reads more naturally.  Not sure if it's
> worth sending that as a separate fix, or drop it entirely.

I see. Sounds logical then. Let's keep it as is.

>
> > With that fixed:
> >
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> <snip>



-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
@ 2023-01-09  9:08         ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09  9:08 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel

On Mon, 9 Jan 2023 at 10:21, Marijn Suijten
<marijn.suijten@somainline.org> wrote:
>
> On 2023-01-09 01:31:57, Dmitry Baryshkov wrote:
> > On 22/12/2022 01:19, Marijn Suijten wrote:
> > > Downstream calls this num_enc yet the DSC patches introduced a new
> > > num_dsc struct member, leaving num_enc effectively unused.
> > >
> > > Fixes: 7e9cc175b159 ("drm/msm/disp/dpu1: Add support for DSC in topology")
> > > Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > > ---
> > >   drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 9 ++++-----
> > >   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c      | 4 ++--
> > >   drivers/gpu/drm/msm/msm_drv.h               | 2 --
> > >   3 files changed, 6 insertions(+), 9 deletions(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > index 9c6817b5a194..a158cd502d38 100644
> > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> > > @@ -579,19 +579,18 @@ static struct msm_display_topology dpu_encoder_get_topology(
> > >                     topology.num_dspp = topology.num_lm;
> > >     }
> > >
> > > -   topology.num_enc = 0;
> > >     topology.num_intf = intf_count;
> > >
> > >     if (dpu_enc->dsc) {
> > > -           /* In case of Display Stream Compression (DSC), we would use
> > > -            * 2 encoders, 2 layer mixers and 1 interface
> > > +           /*
> > > +            * In case of Display Stream Compression (DSC), we would use
> > > +            * 2 DSC encoders, 2 layer mixers and 1 interface
> > >              * this is power optimal and can drive up to (including) 4k
> > >              * screens
> > >              */
> > > -           topology.num_enc = 2;
> > >             topology.num_dsc = 2;
> > > -           topology.num_intf = 1;
> > >             topology.num_lm = 2;
> > > +           topology.num_intf = 1;
> >
> > Unless there is a reason, please move num_intf assignment back while
> > preparing v3.
>
> The assignment was reordered to match the order described in the comment
> right above, such that this reads more naturally.  Not sure if it's
> worth sending that as a separate fix, or drop it entirely.

I see. Sounds logical then. Let's keep it as is.

>
> > With that fixed:
> >
> > Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>
> <snip>



-- 
With best wishes
Dmitry

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2023-01-09  9:06           ` Dmitry Baryshkov
@ 2023-01-09 17:12             ` Marijn Suijten
  -1 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09 17:12 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno,
	Vinod Polimera

On 2023-01-09 11:06:45, Dmitry Baryshkov wrote:
> On Mon, 9 Jan 2023 at 10:24, Marijn Suijten
> <marijn.suijten@somainline.org> wrote:
> >
> > On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
> > > On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> > > > On 22/12/2022 01:19, Marijn Suijten wrote:
> > > >> In the event that the topology requests resources that have not been
> > > >> created by the system (because they are typically not represented in
> > > >> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> > > >> blocks) remain NULL but will still be returned out of
> > > >> dpu_rm_get_assigned_resources, where the caller expects to get an array
> > > >> containing num_blks valid pointers (but instead gets these NULLs).
> > > >>
> > > >> To prevent this from happening, where null-pointer dereferences
> > > >> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> > > >> increase past NULL blocks and will print an error and break instead.
> > > >> After all, max_blks represents the static size of the maximum number of
> > > >> blocks whereas the actual amount varies per platform.
> > > >>
> > > >> ^1: which can happen after a git rebase ended up moving additions to
> > > >> _dpu_cfg to a different struct which has the same patch context.
> > > >>
> > > >> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> > > >> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > > >> ---
> > > >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
> > > >>   1 file changed, 5 insertions(+)
> > > >
> > > > I think the patch is not fully correct. Please check resource
> > > > availability during allocation. I wouldn't expect an error from
> > > > get_assigned_resources because of resource exhaustion.
> >
> > Theoretically patch 5/8 should take care of this, and we should never
> > reach this failure condition.  Emphasis on /should/, this may happen
> > again if/when another block type is added with sub-par resource
> > allocation and assignment implementation.
> 
> Yeah. Maybe swapping 4/8 and 5/8 makes sense.

Ack.

> > > Another option, since allocation functions (except DSC) already have
> > > these safety checks: check error message to mention internal
> > > inconstency: allocated resource doesn't exist.
> >
> > Is this a suggestion for the wording of the error message?
> 
> Yes. Because the current message makes one think that it is output
> during allocation / assignment to encoder, while this is a safety net.

Good.  So the patch is correct, just the wording is off, which I fully
agree on.  This isn't allocating anything, just handing out what was
previously allocated (and is a safety net).

- Marijn

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2023-01-09 17:12             ` Marijn Suijten
  0 siblings, 0 replies; 47+ messages in thread
From: Marijn Suijten @ 2023-01-09 17:12 UTC (permalink / raw)
  To: Dmitry Baryshkov
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

On 2023-01-09 11:06:45, Dmitry Baryshkov wrote:
> On Mon, 9 Jan 2023 at 10:24, Marijn Suijten
> <marijn.suijten@somainline.org> wrote:
> >
> > On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
> > > On 09/01/2023 01:28, Dmitry Baryshkov wrote:
> > > > On 22/12/2022 01:19, Marijn Suijten wrote:
> > > >> In the event that the topology requests resources that have not been
> > > >> created by the system (because they are typically not represented in
> > > >> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
> > > >> blocks) remain NULL but will still be returned out of
> > > >> dpu_rm_get_assigned_resources, where the caller expects to get an array
> > > >> containing num_blks valid pointers (but instead gets these NULLs).
> > > >>
> > > >> To prevent this from happening, where null-pointer dereferences
> > > >> typically result in a hard-to-debug platform lockup, num_blks shouldn't
> > > >> increase past NULL blocks and will print an error and break instead.
> > > >> After all, max_blks represents the static size of the maximum number of
> > > >> blocks whereas the actual amount varies per platform.
> > > >>
> > > >> ^1: which can happen after a git rebase ended up moving additions to
> > > >> _dpu_cfg to a different struct which has the same patch context.
> > > >>
> > > >> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
> > > >> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
> > > >> ---
> > > >>   drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
> > > >>   1 file changed, 5 insertions(+)
> > > >
> > > > I think the patch is not fully correct. Please check resource
> > > > availability during allocation. I wouldn't expect an error from
> > > > get_assigned_resources because of resource exhaustion.
> >
> > Theoretically patch 5/8 should take care of this, and we should never
> > reach this failure condition.  Emphasis on /should/, this may happen
> > again if/when another block type is added with sub-par resource
> > allocation and assignment implementation.
> 
> Yeah. Maybe swapping 4/8 and 5/8 makes sense.

Ack.

> > > Another option, since allocation functions (except DSC) already have
> > > these safety checks: check error message to mention internal
> > > inconstency: allocated resource doesn't exist.
> >
> > Is this a suggestion for the wording of the error message?
> 
> Yes. Because the current message makes one think that it is output
> during allocation / assignment to encoder, while this is a safety net.

Good.  So the patch is correct, just the wording is off, which I fully
agree on.  This isn't allocating anything, just handing out what was
previously allocated (and is a safety net).

- Marijn

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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
  2023-01-09 17:12             ` Marijn Suijten
@ 2023-01-09 18:24               ` Dmitry Baryshkov
  -1 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 18:24 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, phone-devel, Sam Ravnborg,
	Haowen Bai, Vinod Koul, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Abhinav Kumar, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, Drew Davenport, freedreno,
	Vinod Polimera

On 09/01/2023 19:12, Marijn Suijten wrote:
> On 2023-01-09 11:06:45, Dmitry Baryshkov wrote:
>> On Mon, 9 Jan 2023 at 10:24, Marijn Suijten
>> <marijn.suijten@somainline.org> wrote:
>>>
>>> On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
>>>> On 09/01/2023 01:28, Dmitry Baryshkov wrote:
>>>>> On 22/12/2022 01:19, Marijn Suijten wrote:
>>>>>> In the event that the topology requests resources that have not been
>>>>>> created by the system (because they are typically not represented in
>>>>>> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
>>>>>> blocks) remain NULL but will still be returned out of
>>>>>> dpu_rm_get_assigned_resources, where the caller expects to get an array
>>>>>> containing num_blks valid pointers (but instead gets these NULLs).
>>>>>>
>>>>>> To prevent this from happening, where null-pointer dereferences
>>>>>> typically result in a hard-to-debug platform lockup, num_blks shouldn't
>>>>>> increase past NULL blocks and will print an error and break instead.
>>>>>> After all, max_blks represents the static size of the maximum number of
>>>>>> blocks whereas the actual amount varies per platform.
>>>>>>
>>>>>> ^1: which can happen after a git rebase ended up moving additions to
>>>>>> _dpu_cfg to a different struct which has the same patch context.
>>>>>>
>>>>>> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
>>>>>> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
>>>>>> ---
>>>>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>>>>>>    1 file changed, 5 insertions(+)
>>>>>
>>>>> I think the patch is not fully correct. Please check resource
>>>>> availability during allocation. I wouldn't expect an error from
>>>>> get_assigned_resources because of resource exhaustion.
>>>
>>> Theoretically patch 5/8 should take care of this, and we should never
>>> reach this failure condition.  Emphasis on /should/, this may happen
>>> again if/when another block type is added with sub-par resource
>>> allocation and assignment implementation.
>>
>> Yeah. Maybe swapping 4/8 and 5/8 makes sense.
> 
> Ack.
> 
>>>> Another option, since allocation functions (except DSC) already have
>>>> these safety checks: check error message to mention internal
>>>> inconstency: allocated resource doesn't exist.
>>>
>>> Is this a suggestion for the wording of the error message?
>>
>> Yes. Because the current message makes one think that it is output
>> during allocation / assignment to encoder, while this is a safety net.
> 
> Good.  So the patch is correct, just the wording is off, which I fully
> agree on.  This isn't allocating anything, just handing out what was
> previously allocated (and is a safety net).

Yes. Please excuse me if my original message was not 100% clear.

> 
> - Marijn

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned
@ 2023-01-09 18:24               ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 18:24 UTC (permalink / raw)
  To: Marijn Suijten
  Cc: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul,
	~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel, Drew Davenport

On 09/01/2023 19:12, Marijn Suijten wrote:
> On 2023-01-09 11:06:45, Dmitry Baryshkov wrote:
>> On Mon, 9 Jan 2023 at 10:24, Marijn Suijten
>> <marijn.suijten@somainline.org> wrote:
>>>
>>> On 2023-01-09 01:30:29, Dmitry Baryshkov wrote:
>>>> On 09/01/2023 01:28, Dmitry Baryshkov wrote:
>>>>> On 22/12/2022 01:19, Marijn Suijten wrote:
>>>>>> In the event that the topology requests resources that have not been
>>>>>> created by the system (because they are typically not represented in
>>>>>> dpu_mdss_cfg ^1), the resource(s) in global_state (in this case DSC
>>>>>> blocks) remain NULL but will still be returned out of
>>>>>> dpu_rm_get_assigned_resources, where the caller expects to get an array
>>>>>> containing num_blks valid pointers (but instead gets these NULLs).
>>>>>>
>>>>>> To prevent this from happening, where null-pointer dereferences
>>>>>> typically result in a hard-to-debug platform lockup, num_blks shouldn't
>>>>>> increase past NULL blocks and will print an error and break instead.
>>>>>> After all, max_blks represents the static size of the maximum number of
>>>>>> blocks whereas the actual amount varies per platform.
>>>>>>
>>>>>> ^1: which can happen after a git rebase ended up moving additions to
>>>>>> _dpu_cfg to a different struct which has the same patch context.
>>>>>>
>>>>>> Fixes: bb00a452d6f7 ("drm/msm/dpu: Refactor resource manager")
>>>>>> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
>>>>>> ---
>>>>>>    drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c | 5 +++++
>>>>>>    1 file changed, 5 insertions(+)
>>>>>
>>>>> I think the patch is not fully correct. Please check resource
>>>>> availability during allocation. I wouldn't expect an error from
>>>>> get_assigned_resources because of resource exhaustion.
>>>
>>> Theoretically patch 5/8 should take care of this, and we should never
>>> reach this failure condition.  Emphasis on /should/, this may happen
>>> again if/when another block type is added with sub-par resource
>>> allocation and assignment implementation.
>>
>> Yeah. Maybe swapping 4/8 and 5/8 makes sense.
> 
> Ack.
> 
>>>> Another option, since allocation functions (except DSC) already have
>>>> these safety checks: check error message to mention internal
>>>> inconstency: allocated resource doesn't exist.
>>>
>>> Is this a suggestion for the wording of the error message?
>>
>> Yes. Because the current message makes one think that it is output
>> during allocation / assignment to encoder, while this is a safety net.
> 
> Good.  So the patch is correct, just the wording is off, which I fully
> agree on.  This isn't allocating anything, just handing out what was
> previously allocated (and is a safety net).

Yes. Please excuse me if my original message was not 100% clear.

> 
> - Marijn

-- 
With best wishes
Dmitry


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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2023-01-09 22:41   ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 22:41 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul, Marijn Suijten
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel


On Thu, 22 Dec 2022 00:19:35 +0100, Marijn Suijten wrote:
> This preliminary Display Stream Compression support package for
> (initially tested on) sm8[12]50 is based on comparing DSC behaviour
> between downstream and mainline.  Some new callbacks are added (for
> binding blocks on active CTLs), logic bugs are corrected, zeroed struct
> members are now assigned proper values, and RM allocation and hw block
> retrieval now hand out (or not) DSC blocks without causing null-pointer
> dereferences.
> 
> [...]

Applied, thanks!

[1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
      https://gitlab.freedesktop.org/lumag/msm/-/commit/c2d2c62da1fc
[2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count
      https://gitlab.freedesktop.org/lumag/msm/-/commit/bbd1bccdcf4e
[3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
      https://gitlab.freedesktop.org/lumag/msm/-/commit/85b5a40991dd
[5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
      https://gitlab.freedesktop.org/lumag/msm/-/commit/f52b965c9434
[6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
      https://gitlab.freedesktop.org/lumag/msm/-/commit/9ce765395f41
[7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1
      https://gitlab.freedesktop.org/lumag/msm/-/commit/086116ae1410
[8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
      https://gitlab.freedesktop.org/lumag/msm/-/commit/8cc4c9de15f4

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2023-01-09 22:41   ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 22:41 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul, Marijn Suijten
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno


On Thu, 22 Dec 2022 00:19:35 +0100, Marijn Suijten wrote:
> This preliminary Display Stream Compression support package for
> (initially tested on) sm8[12]50 is based on comparing DSC behaviour
> between downstream and mainline.  Some new callbacks are added (for
> binding blocks on active CTLs), logic bugs are corrected, zeroed struct
> members are now assigned proper values, and RM allocation and hw block
> retrieval now hand out (or not) DSC blocks without causing null-pointer
> dereferences.
> 
> [...]

Applied, thanks!

[1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
      https://gitlab.freedesktop.org/lumag/msm/-/commit/c2d2c62da1fc
[2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count
      https://gitlab.freedesktop.org/lumag/msm/-/commit/bbd1bccdcf4e
[3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
      https://gitlab.freedesktop.org/lumag/msm/-/commit/85b5a40991dd
[5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
      https://gitlab.freedesktop.org/lumag/msm/-/commit/f52b965c9434
[6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
      https://gitlab.freedesktop.org/lumag/msm/-/commit/9ce765395f41
[7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1
      https://gitlab.freedesktop.org/lumag/msm/-/commit/086116ae1410
[8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
      https://gitlab.freedesktop.org/lumag/msm/-/commit/8cc4c9de15f4

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2023-01-09 22:41   ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 23:43 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul, Marijn Suijten
  Cc: ~postmarketos/upstreaming, AngeloGioacchino Del Regno,
	Konrad Dybcio, Martin Botka, Jami Kettunen, Sean Paul,
	David Airlie, Daniel Vetter, Stephen Boyd, Bjorn Andersson,
	Jessica Zhang, Ville Syrjälä,
	Kuogee Hsieh, Jani Nikula, sunliming, Sam Ravnborg, Haowen Bai,
	Konrad Dybcio, Loic Poulain, Vinod Polimera, Douglas Anderson,
	Vladimir Lypak, linux-arm-msm, dri-devel, freedreno,
	linux-kernel


On Thu, 22 Dec 2022 00:19:35 +0100, Marijn Suijten wrote:
> This preliminary Display Stream Compression support package for
> (initially tested on) sm8[12]50 is based on comparing DSC behaviour
> between downstream and mainline.  Some new callbacks are added (for
> binding blocks on active CTLs), logic bugs are corrected, zeroed struct
> members are now assigned proper values, and RM allocation and hw block
> retrieval now hand out (or not) DSC blocks without causing null-pointer
> dereferences.
> 
> [...]

Applied, thanks!

[1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
      https://gitlab.freedesktop.org/lumag/msm/-/commit/c2d2c62da1fc
[2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count
      https://gitlab.freedesktop.org/lumag/msm/-/commit/bbd1bccdcf4e
[3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
      https://gitlab.freedesktop.org/lumag/msm/-/commit/85b5a40991dd
[5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
      https://gitlab.freedesktop.org/lumag/msm/-/commit/f52b965c9434
[6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
      https://gitlab.freedesktop.org/lumag/msm/-/commit/9ce765395f41
[7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1
      https://gitlab.freedesktop.org/lumag/msm/-/commit/086116ae1410
[8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
      https://gitlab.freedesktop.org/lumag/msm/-/commit/8cc4c9de15f4

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

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

* Re: [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50
@ 2023-01-09 22:41   ` Dmitry Baryshkov
  0 siblings, 0 replies; 47+ messages in thread
From: Dmitry Baryshkov @ 2023-01-09 23:43 UTC (permalink / raw)
  To: phone-devel, Rob Clark, Abhinav Kumar, Vinod Koul, Marijn Suijten
  Cc: Konrad Dybcio, dri-devel, linux-kernel,
	AngeloGioacchino Del Regno, Vinod Polimera, Sam Ravnborg,
	Haowen Bai, Kuogee Hsieh, Jessica Zhang, Jani Nikula,
	linux-arm-msm, Stephen Boyd, Martin Botka,
	~postmarketos/upstreaming, Sean Paul, Loic Poulain,
	Jami Kettunen, Bjorn Andersson, Vladimir Lypak, Douglas Anderson,
	Konrad Dybcio, sunliming, freedreno


On Thu, 22 Dec 2022 00:19:35 +0100, Marijn Suijten wrote:
> This preliminary Display Stream Compression support package for
> (initially tested on) sm8[12]50 is based on comparing DSC behaviour
> between downstream and mainline.  Some new callbacks are added (for
> binding blocks on active CTLs), logic bugs are corrected, zeroed struct
> members are now assigned proper values, and RM allocation and hw block
> retrieval now hand out (or not) DSC blocks without causing null-pointer
> dereferences.
> 
> [...]

Applied, thanks!

[1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration
      https://gitlab.freedesktop.org/lumag/msm/-/commit/c2d2c62da1fc
[2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count
      https://gitlab.freedesktop.org/lumag/msm/-/commit/bbd1bccdcf4e
[3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
      https://gitlab.freedesktop.org/lumag/msm/-/commit/85b5a40991dd
[5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available
      https://gitlab.freedesktop.org/lumag/msm/-/commit/f52b965c9434
[6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc
      https://gitlab.freedesktop.org/lumag/msm/-/commit/9ce765395f41
[7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1
      https://gitlab.freedesktop.org/lumag/msm/-/commit/086116ae1410
[8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250
      https://gitlab.freedesktop.org/lumag/msm/-/commit/8cc4c9de15f4

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

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

end of thread, other threads:[~2023-01-10  8:29 UTC | newest]

Thread overview: 47+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-21 23:19 [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50 Marijn Suijten
2022-12-21 23:19 ` Marijn Suijten
2022-12-21 23:19 ` [PATCH v2 1/8] drm/msm/dpu: Wire up DSC mask for active CTL configuration Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2023-01-08 23:23   ` Dmitry Baryshkov
2023-01-08 23:23     ` Dmitry Baryshkov
2022-12-21 23:19 ` [PATCH v2 2/8] drm/msm/dsi: Use DSC slice(s) packet size to compute word count Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2022-12-21 23:19 ` [PATCH v2 3/8] drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2022-12-21 23:19 ` [PATCH v2 4/8] drm/msm/dpu: Disallow unallocated resources to be returned Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2023-01-08 23:28   ` Dmitry Baryshkov
2023-01-08 23:28     ` Dmitry Baryshkov
2023-01-08 23:30     ` Dmitry Baryshkov
2023-01-08 23:30       ` Dmitry Baryshkov
2023-01-09  8:23       ` Marijn Suijten
2023-01-09  8:23         ` Marijn Suijten
2023-01-09  9:06         ` Dmitry Baryshkov
2023-01-09  9:06           ` Dmitry Baryshkov
2023-01-09 17:12           ` Marijn Suijten
2023-01-09 17:12             ` Marijn Suijten
2023-01-09 18:24             ` Dmitry Baryshkov
2023-01-09 18:24               ` Dmitry Baryshkov
2022-12-21 23:19 ` [PATCH v2 5/8] drm/msm/dpu: Reject topologies for which no DSC blocks are available Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2023-01-08 23:29   ` Dmitry Baryshkov
2023-01-08 23:29     ` Dmitry Baryshkov
2022-12-21 23:19 ` [PATCH v2 6/8] drm/msm/dpu: Remove num_enc from topology struct in favour of num_dsc Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2023-01-08 23:31   ` Dmitry Baryshkov
2023-01-08 23:31     ` Dmitry Baryshkov
2023-01-09  8:21     ` Marijn Suijten
2023-01-09  8:21       ` Marijn Suijten
2023-01-09  9:08       ` Dmitry Baryshkov
2023-01-09  9:08         ` Dmitry Baryshkov
2022-12-21 23:19 ` [PATCH v2 7/8] drm/msm/dpu: Implement DSC binding to PP block for CTL V1 Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2022-12-21 23:19 ` [PATCH v2 8/8] drm/msm/dpu: Add DSC configuration for SM8150 and SM8250 Marijn Suijten
2022-12-21 23:19   ` Marijn Suijten
2023-01-05 14:49 ` [PATCH v2 0/8] drm/msm: DSC Electric Boogaloo for sm8[12]50 Daniel Vetter
2023-01-05 14:49   ` Daniel Vetter
2023-01-09  7:59   ` Marijn Suijten
2023-01-09 22:41 ` Dmitry Baryshkov
2023-01-09 23:43   ` Dmitry Baryshkov
2023-01-09 23:43   ` Dmitry Baryshkov
2023-01-09 22:41   ` Dmitry Baryshkov

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.