Commit 5d34b050 authored by Dave Airlie's avatar Dave Airlie
Browse files

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: default avatarDave Airlie <airlied@redhat.com>
From: Rob Clark <robdclark@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvxF2p3-AsjUydmSYrA0Vb+Ea7nh3VtNX0pT0Ae_Me-Kw@mail.gmail.com
parents 47ac09b9 624ab9cd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -99,7 +99,7 @@ static int zap_shader_load_mdt(struct msm_gpu *gpu, const char *fwname,
		 * was a bad idea, and is only provided for backwards
		 * compatibility for older targets.
		 */
		return -ENODEV;
		return -ENOENT;
	}

	if (IS_ERR(fw)) {
+2 −2
Original line number Diff line number Diff line
@@ -1171,8 +1171,6 @@ static void dpu_encoder_virt_atomic_mode_set(struct drm_encoder *drm_enc,

	cstate->num_mixers = num_lm;

	dpu_enc->connector = conn_state->connector;

	for (i = 0; i < dpu_enc->num_phys_encs; i++) {
		struct dpu_encoder_phys *phys = dpu_enc->phys_encs[i];

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

	dpu_enc->commit_done_timedout = false;

	dpu_enc->connector = drm_atomic_get_new_connector_for_encoder(state, drm_enc);

	cur_mode = &dpu_enc->base.crtc->state->adjusted_mode;

	dpu_enc->wide_bus_en = dpu_encoder_is_widebus_enabled(drm_enc);
+2 −2
Original line number Diff line number Diff line
@@ -308,8 +308,8 @@ static const u32 wb2_formats_rgb_yuv[] = {
	{ \
	.maxdwnscale = SSPP_UNITY_SCALE, \
	.maxupscale = SSPP_UNITY_SCALE, \
	.format_list = plane_formats_yuv, \
	.num_formats = ARRAY_SIZE(plane_formats_yuv), \
	.format_list = plane_formats, \
	.num_formats = ARRAY_SIZE(plane_formats), \
	.virt_format_list = plane_formats, \
	.virt_num_formats = ARRAY_SIZE(plane_formats), \
	}
+2 −12
Original line number Diff line number Diff line
@@ -31,24 +31,14 @@
 * @fmt: Pointer to format string
 */
#define DPU_DEBUG(fmt, ...)                                                \
	do {                                                               \
		if (drm_debug_enabled(DRM_UT_KMS))                         \
			DRM_DEBUG(fmt, ##__VA_ARGS__); \
		else                                                       \
			pr_debug(fmt, ##__VA_ARGS__);                      \
	} while (0)
	DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)

/**
 * DPU_DEBUG_DRIVER - macro for hardware driver logging
 * @fmt: Pointer to format string
 */
#define DPU_DEBUG_DRIVER(fmt, ...)                                         \
	do {                                                               \
		if (drm_debug_enabled(DRM_UT_DRIVER))                      \
			DRM_ERROR(fmt, ##__VA_ARGS__); \
		else                                                       \
			pr_debug(fmt, ##__VA_ARGS__);                      \
	} while (0)
	DRM_DEBUG_DRIVER(fmt, ##__VA_ARGS__)

#define DPU_ERROR(fmt, ...) pr_err("[dpu error]" fmt, ##__VA_ARGS__)
#define DPU_ERROR_RATELIMITED(fmt, ...) pr_err_ratelimited("[dpu error]" fmt, ##__VA_ARGS__)
+17 −3
Original line number Diff line number Diff line
@@ -681,6 +681,9 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
			new_state->fb, &layout);
	if (ret) {
		DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret);
		if (pstate->aspace)
			msm_framebuffer_cleanup(new_state->fb, pstate->aspace,
						pstate->needs_dirtyfb);
		return ret;
	}

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

	if (MSM_FORMAT_IS_YUV(fmt) &&
	    (!pipe->sspp->cap->sblk->scaler_blk.len ||
	     !pipe->sspp->cap->sblk->csc_blk.len)) {
	    !pipe->sspp->cap->sblk->csc_blk.len) {
		DPU_DEBUG_PLANE(pdpu,
				"plane doesn't have scaler/csc for yuv\n");
				"plane doesn't have csc for yuv\n");
		return -EINVAL;
	}

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

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

	drm_rect_rotate(&pipe_cfg->src_rect,
			new_plane_state->fb->width, new_plane_state->fb->height,
			new_plane_state->rotation);

	if ((drm_rect_width(&pipe_cfg->src_rect) > max_linewidth) ||
	     _dpu_plane_calc_clk(&crtc_state->adjusted_mode, pipe_cfg) > max_mdp_clk_rate) {
		/*
@@ -913,6 +919,14 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
		r_pipe_cfg->dst_rect.x1 = pipe_cfg->dst_rect.x2;
	}

	drm_rect_rotate_inv(&pipe_cfg->src_rect,
			    new_plane_state->fb->width, new_plane_state->fb->height,
			    new_plane_state->rotation);
	if (r_pipe->sspp)
		drm_rect_rotate_inv(&r_pipe_cfg->src_rect,
				    new_plane_state->fb->width, new_plane_state->fb->height,
				    new_plane_state->rotation);

	ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt, &crtc_state->adjusted_mode);
	if (ret)
		return ret;
Loading