Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/msm/mdp5: Add a CAP for Source Split

Some of the newer MDP5 versions support Source Split of SSPPs. It is a
feature that allows us to route the output of a hwpipe to 2 Layer
Mixers. This is required to achieve the following use cases:

- Dual DSI: For high res DSI panels (such as 2560x1600 etc), a single
DSI interface doesn't have the bandwidth to drive the required pixel
clock. We use 2 DSI interfaces to drive the left and right halves
of the panel (i.e, 1280x1600 each). The MDP5 pipeline here would look
like:

LM0 -- DSPP0 -- INTF1 -- DSI1
/
hwpipe--
\
LM1 -- DSPP1 -- INTF2 -- DSI2

A single hwpipe is used to scan out the left and right halves to DSI1
and DSI2 respectively. In order to do this, we need to configure the
2 Layer Mixers in Source Split mode.

- HDMI 4K: In order to support resolutions with width higher than the
max width supported by a hwpipe, we club 2 hwpipes together:

hwpipe1 --- LM0 -- DSPP0
- - \
- -- 3D Mux -- INTF0 -- HDMI
- - /
hwpipe2 --- LM1 -- DSPP1

hwpipe1 is staged on the 'left' Layer Mixer, and hwpipe2 is staged on
the 'right' Layer Mixer. An additional block called the '3D Mux' is
used to merge the output of the 2 DSPPs to a single interface.
In this use case, it is possible that a 4K surface is downscaled and
placed completely within one of the halves. In order to support such
scenarios (and keep the programming simple), Layer Mixers with Source
Split can be assigned 2 hw pipes per stage. While scanning out, the HW
takes care of fetching the pixels fom the correct pipe.

Add a MDP cap to tell whether the HW supports source split or not.
Add a MDP LM cap that tells whether a LM instance can operate in
source split mode (and generate the 'left' part of the display
output).

Signed-off-by: Archit Taneja <architt@codeaurora.org>
Signed-off-by: Rob Clark <robdclark@gmail.com>

authored by

Archit Taneja and committed by
Rob Clark
621da7d9 f316b25a

+17 -6
+15 -6
drivers/gpu/drm/msm/mdp/mdp5/mdp5_cfg.c
··· 191 191 .mdp = { 192 192 .count = 1, 193 193 .caps = MDP_CAP_SMP | 194 + MDP_CAP_SRC_SPLIT | 194 195 0, 195 196 }, 196 197 .smp = { ··· 238 237 .base = { 0x03900, 0x03d00, 0x04100, 0x04500, 0x04900, 0x04d00 }, 239 238 .instances = { 240 239 { .id = 0, .pp = 0, .dspp = 0, 241 - .caps = MDP_LM_CAP_DISPLAY, }, 240 + .caps = MDP_LM_CAP_DISPLAY | 241 + MDP_LM_CAP_PAIR, }, 242 242 { .id = 1, .pp = 1, .dspp = 1, 243 243 .caps = MDP_LM_CAP_DISPLAY, }, 244 244 { .id = 2, .pp = 2, .dspp = 2, 245 - .caps = MDP_LM_CAP_DISPLAY, }, 245 + .caps = MDP_LM_CAP_DISPLAY | 246 + MDP_LM_CAP_PAIR, }, 246 247 { .id = 3, .pp = -1, .dspp = -1, 247 248 .caps = MDP_LM_CAP_WB, }, 248 249 { .id = 4, .pp = -1, .dspp = -1, ··· 353 350 .mdp = { 354 351 .count = 1, 355 352 .caps = MDP_CAP_SMP | 353 + MDP_CAP_SRC_SPLIT | 356 354 0, 357 355 }, 358 356 .smp = { ··· 400 396 .base = { 0x44000, 0x45000, 0x46000, 0x47000, 0x48000, 0x49000 }, 401 397 .instances = { 402 398 { .id = 0, .pp = 0, .dspp = 0, 403 - .caps = MDP_LM_CAP_DISPLAY, }, 399 + .caps = MDP_LM_CAP_DISPLAY | 400 + MDP_LM_CAP_PAIR, }, 404 401 { .id = 1, .pp = 1, .dspp = 1, 405 402 .caps = MDP_LM_CAP_DISPLAY, }, 406 403 { .id = 2, .pp = 2, .dspp = 2, 407 - .caps = MDP_LM_CAP_DISPLAY, }, 404 + .caps = MDP_LM_CAP_DISPLAY | 405 + MDP_LM_CAP_PAIR, }, 408 406 { .id = 3, .pp = -1, .dspp = -1, 409 407 .caps = MDP_LM_CAP_WB, }, 410 408 { .id = 4, .pp = -1, .dspp = -1, ··· 449 443 .count = 1, 450 444 .caps = MDP_CAP_DSC | 451 445 MDP_CAP_CDM | 446 + MDP_CAP_SRC_SPLIT | 452 447 0, 453 448 }, 454 449 .ctl = { ··· 501 494 .base = { 0x44000, 0x45000, 0x46000, 0x47000, 0x48000, 0x49000 }, 502 495 .instances = { 503 496 { .id = 0, .pp = 0, .dspp = 0, 504 - .caps = MDP_LM_CAP_DISPLAY }, 497 + .caps = MDP_LM_CAP_DISPLAY | 498 + MDP_LM_CAP_PAIR, }, 505 499 { .id = 1, .pp = 1, .dspp = 1, 506 500 .caps = MDP_LM_CAP_DISPLAY, }, 507 501 { .id = 2, .pp = 2, .dspp = -1, 508 - .caps = MDP_LM_CAP_DISPLAY }, 502 + .caps = MDP_LM_CAP_DISPLAY | 503 + MDP_LM_CAP_PAIR, }, 509 504 { .id = 3, .pp = -1, .dspp = -1, 510 505 .caps = MDP_LM_CAP_WB, }, 511 506 { .id = 4, .pp = -1, .dspp = -1,
+2
drivers/gpu/drm/msm/mdp/mdp_kms.h
··· 104 104 #define MDP_CAP_SMP BIT(0) /* Shared Memory Pool */ 105 105 #define MDP_CAP_DSC BIT(1) /* VESA Display Stream Compression */ 106 106 #define MDP_CAP_CDM BIT(2) /* Chroma Down Module (HDMI 2.0 YUV) */ 107 + #define MDP_CAP_SRC_SPLIT BIT(3) /* Source Split of SSPPs */ 107 108 108 109 /* MDP pipe capabilities */ 109 110 #define MDP_PIPE_CAP_HFLIP BIT(0) ··· 118 117 /* MDP layer mixer caps */ 119 118 #define MDP_LM_CAP_DISPLAY BIT(0) 120 119 #define MDP_LM_CAP_WB BIT(1) 120 + #define MDP_LM_CAP_PAIR BIT(2) 121 121 122 122 static inline bool pipe_supports_yuv(uint32_t pipe_caps) 123 123 {