Skip to content

Commit 5fddd4f

Browse files
Kalyan Thotarobclark
authored andcommitted
drm/msm/dpu: request for display color blocks based on hw catalog entry
Request for color processing blocks only if they are available in the display hw catalog and they are sufficient in number for the selection. Signed-off-by: Kalyan Thota <[email protected]> Fixes: e47616d ("drm/msm/dpu: add support for color processing Tested-by: John Stultz <[email protected]> Signed-off-by: Rob Clark <[email protected]>
1 parent 1cb2c4a commit 5fddd4f

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ static struct msm_display_topology dpu_encoder_get_topology(
521521
struct dpu_kms *dpu_kms,
522522
struct drm_display_mode *mode)
523523
{
524-
struct msm_display_topology topology;
524+
struct msm_display_topology topology = {0};
525525
int i, intf_count = 0;
526526

527527
for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
@@ -537,7 +537,8 @@ static struct msm_display_topology dpu_encoder_get_topology(
537537
* 1 LM, 1 INTF
538538
* 2 LM, 1 INTF (stream merge to support high resolution interfaces)
539539
*
540-
* Adding color blocks only to primary interface
540+
* Adding color blocks only to primary interface if available in
541+
* sufficient number
541542
*/
542543
if (intf_count == 2)
543544
topology.num_lm = 2;
@@ -546,8 +547,11 @@ static struct msm_display_topology dpu_encoder_get_topology(
546547
else
547548
topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
548549

549-
if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI)
550-
topology.num_dspp = topology.num_lm;
550+
if (dpu_enc->disp_info.intf_type == DRM_MODE_ENCODER_DSI) {
551+
if (dpu_kms->catalog->dspp &&
552+
(dpu_kms->catalog->dspp_count >= topology.num_lm))
553+
topology.num_dspp = topology.num_lm;
554+
}
551555

552556
topology.num_enc = 0;
553557
topology.num_intf = intf_count;

0 commit comments

Comments
 (0)