Skip to content

Commit 5d34b05

Browse files
committed
Merge tag 'drm-msm-fixes-2024-08-19' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
Fixes for v6.11-rc5 1) Fixes from the virtual plane series, namely - fix the list of formats for QCM2290 since it has no YUV support - minor fix in dpu_plane_atomic_check_pipe() to check only for csc and not csc and scaler while allowing yuv formats - take rotation into account while allocating virtual planes 2) Fix to cleanup FB if dpu_format_populate_layout() fails. This fixes the warning splat during DRM file closure 3) Fix to reset the phy link params before re-starting link training. This fixes the 100% link training failure when someone starts modetest while cable is connected 4) Long pending fix to fix a visual corruption seen for 4k modes. Root-cause was we cannot support 4k@30 with 30bpp with 2 lanes so this is a critical fix to use 24bpp for such cases 5) Fix to move dpu encoder's connector assignment to atomic_enable(). This fixes the NULL ptr crash for cases when there is an atomic_enable() without atomic_modeset() after atomic_disable() . This happens for connectors_changed case of crtc. It fixes a NULL ptr crash reported during hotplug. 6) Fix to simplify DPU's debug macros without which dynamic debug does not work as expected 7) Fix the highest bank bit setting for sc7180 8) adreno: fix error return if missing firmware-name Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvxF2p3-AsjUydmSYrA0Vb+Ea7nh3VtNX0pT0Ae_Me-Kw@mail.gmail.com
2 parents 47ac09b + 624ab9c commit 5d34b05

File tree

8 files changed

+37
-30
lines changed

8 files changed

+37
-30
lines changed

drivers/gpu/drm/msm/adreno/adreno_gpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
9999
* was a bad idea, and is only provided for backwards
100100
* compatibility for older targets.
101101
*/
102-
return -ENODEV;
102+
return -ENOENT;
103103
}
104104

105105
if (IS_ERR(fw)) {

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,8 +1171,6 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc,
11711171

11721172
cstate->num_mixers = num_lm;
11731173

1174-
dpu_enc->connector = conn_state->connector;
1175-
11761174
for (i = 0; i < dpu_enc->num_phys_encs; i++) {
11771175
struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];
11781176

@@ -1270,6 +1268,8 @@ static void dpu_encoder_virt_atomic_enable(struct drm_encoder *drm_enc,
12701268

12711269
dpu_enc->commit_done_timedout = false;
12721270

1271+
dpu_enc->connector = drm_atomic_get_new_connector_for_encoder(state, drm_enc);
1272+
12731273
cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;
12741274

12751275
dpu_enc->wide_bus_en = dpu_encoder_is_widebus_enabled(drm_enc);

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ static const u32 wb2_formats_rgb_yuv[] = {
308308
{ \
309309
.maxdwnscale = SSPP_UNITY_SCALE, \
310310
.maxupscale = SSPP_UNITY_SCALE, \
311-
.format_list = plane_formats_yuv, \
312-
.num_formats = ARRAY_SIZE(plane_formats_yuv), \
311+
.format_list = plane_formats, \
312+
.num_formats = ARRAY_SIZE(plane_formats), \
313313
.virt_format_list = plane_formats, \
314314
.virt_num_formats = ARRAY_SIZE(plane_formats), \
315315
}

drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,14 @@
3131
* @fmt: Pointer to format string
3232
*/
3333
#define DPU_DEBUG(fmt, ...) \
34-
do { \
35-
if (drm_debug_enabled(DRM_UT_KMS)) \
36-
DRM_DEBUG(fmt, ##__VA_ARGS__); \
37-
else \
38-
pr_debug(fmt, ##__VA_ARGS__); \
39-
} while (0)
34+
DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
4035

4136
/**
4237
* DPU_DEBUG_DRIVER - macro for hardware driver logging
4338
* @fmt: Pointer to format string
4439
*/
4540
#define DPU_DEBUG_DRIVER(fmt, ...) \
46-
do { \
47-
if (drm_debug_enabled(DRM_UT_DRIVER)) \
48-
DRM_ERROR(fmt, ##__VA_ARGS__); \
49-
else \
50-
pr_debug(fmt, ##__VA_ARGS__); \
51-
} while (0)
41+
DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)
5242

5343
#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
5444
#define DPU_ERROR_RATELIMITED(fmt, ...) pr_err_ratelimited("[dpu error]" fmt, ##__VA_ARGS__)

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

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -681,6 +681,9 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
681681
new_state->fb, &layout);
682682
if (ret) {
683683
DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret);
684+
if (pstate->aspace)
685+
msm_framebuffer_cleanup(new_state->fb, pstate->aspace,
686+
pstate->needs_dirtyfb);
684687
return ret;
685688
}
686689

@@ -744,10 +747,9 @@ static int dpu_plane_atomic_check_pipe(struct dpu_plane *pdpu,
744747
min_src_size = MSM_FORMAT_IS_YUV(fmt) ? 2 : 1;
745748

746749
if (MSM_FORMAT_IS_YUV(fmt) &&
747-
(!pipe->sspp->cap->sblk->scaler_blk.len ||
748-
!pipe->sspp->cap->sblk->csc_blk.len)) {
750+
!pipe->sspp->cap->sblk->csc_blk.len) {
749751
DPU_DEBUG_PLANE(pdpu,
750-
"plane doesn't have scaler/csc for yuv\n");
752+
"plane doesn't have csc for yuv\n");
751753
return -EINVAL;
752754
}
753755

@@ -864,6 +866,10 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
864866

865867
max_linewidth = pdpu->catalog->caps->max_linewidth;
866868

869+
drm_rect_rotate(&pipe_cfg->src_rect,
870+
new_plane_state->fb->width, new_plane_state->fb->height,
871+
new_plane_state->rotation);
872+
867873
if ((drm_rect_width(&pipe_cfg->src_rect) > max_linewidth) ||
868874
_dpu_plane_calc_clk(&crtc_state->adjusted_mode, pipe_cfg) > max_mdp_clk_rate) {
869875
/*
@@ -913,6 +919,14 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
913919
r_pipe_cfg->dst_rect.x1 = pipe_cfg->dst_rect.x2;
914920
}
915921

922+
drm_rect_rotate_inv(&pipe_cfg->src_rect,
923+
new_plane_state->fb->width, new_plane_state->fb->height,
924+
new_plane_state->rotation);
925+
if (r_pipe->sspp)
926+
drm_rect_rotate_inv(&r_pipe_cfg->src_rect,
927+
new_plane_state->fb->width, new_plane_state->fb->height,
928+
new_plane_state->rotation);
929+
916930
ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt, &crtc_state->adjusted_mode);
917931
if (ret)
918932
return ret;

drivers/gpu/drm/msm/dp/dp_ctrl.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,6 +1286,8 @@ static int dp_ctrl_link_train(struct dp_ctrl_private *ctrl,
12861286
link_info.rate = ctrl->link->link_params.rate;
12871287
link_info.capabilities = DP_LINK_CAP_ENHANCED_FRAMING;
12881288

1289+
dp_link_reset_phy_params_vx_px(ctrl->link);
1290+
12891291
dp_aux_link_configure(ctrl->aux, &link_info);
12901292

12911293
if (drm_dp_max_downspread(dpcd))

drivers/gpu/drm/msm/dp/dp_panel.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -90,22 +90,22 @@ static int dp_panel_read_dpcd(struct dp_panel *dp_panel)
9090
static u32 dp_panel_get_supported_bpp(struct dp_panel *dp_panel,
9191
u32 mode_edid_bpp, u32 mode_pclk_khz)
9292
{
93-
struct dp_link_info *link_info;
93+
const struct dp_link_info *link_info;
9494
const u32 max_supported_bpp = 30, min_supported_bpp = 18;
95-
u32 bpp = 0, data_rate_khz = 0;
95+
u32 bpp, data_rate_khz;
9696

97-
bpp = min_t(u32, mode_edid_bpp, max_supported_bpp);
97+
bpp = min(mode_edid_bpp, max_supported_bpp);
9898

9999
link_info = &dp_panel->link_info;
100100
data_rate_khz = link_info->num_lanes * link_info->rate * 8;
101101

102-
while (bpp > min_supported_bpp) {
102+
do {
103103
if (mode_pclk_khz * bpp <= data_rate_khz)
104-
break;
104+
return bpp;
105105
bpp -= 6;
106-
}
106+
} while (bpp > min_supported_bpp);
107107

108-
return bpp;
108+
return min_supported_bpp;
109109
}
110110

111111
int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
@@ -423,8 +423,9 @@ int dp_panel_init_panel_info(struct dp_panel *dp_panel)
423423
drm_mode->clock);
424424
drm_dbg_dp(panel->drm_dev, "bpp = %d\n", dp_panel->dp_mode.bpp);
425425

426-
dp_panel->dp_mode.bpp = max_t(u32, 18,
427-
min_t(u32, dp_panel->dp_mode.bpp, 30));
426+
dp_panel->dp_mode.bpp = dp_panel_get_mode_bpp(dp_panel, dp_panel->dp_mode.bpp,
427+
dp_panel->dp_mode.drm_mode.clock);
428+
428429
drm_dbg_dp(panel->drm_dev, "updated bpp = %d\n",
429430
dp_panel->dp_mode.bpp);
430431

drivers/gpu/drm/msm/msm_mdss.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -577,7 +577,7 @@ static const struct msm_mdss_data sc7180_data = {
577577
.ubwc_enc_version = UBWC_2_0,
578578
.ubwc_dec_version = UBWC_2_0,
579579
.ubwc_static = 0x1e,
580-
.highest_bank_bit = 0x3,
580+
.highest_bank_bit = 0x1,
581581
.reg_bus_bw = 76800,
582582
};
583583

0 commit comments

Comments
 (0)