Merge tag 'drm-msm-fixes-2025-04-18' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
Fixes for v6.15-rc3 Display: - Fix to call dpu_plane_atomic_check_pipe() for both SSPPs in case of multi-rect - Fix to validate plane_state pointer before using it in dpu_plane_virtual_atomic_check() - Fix to make sure dereferencing dpu_encoder_phys happens after making sure it is valid in _dpu_encoder_trigger_start() - Remove the remaining intr_tear_rd_ptr which we initialized to -1 because NO_IRQ indices start from 0 now GPU: - Fix IB_SIZE overflow Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rob Clark <robdclark@gmail.com> Link: https://lore.kernel.org/r/CAF6AEGtVKXEVdzUzFWmQE8JmK3nx_hp+ynOd-5j3vnfcU-sgOA@mail.gmail.com
This commit is contained in:
@@ -242,10 +242,10 @@ static void a6xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
|
||||
break;
|
||||
fallthrough;
|
||||
case MSM_SUBMIT_CMD_BUF:
|
||||
OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
|
||||
OUT_PKT7(ring, CP_INDIRECT_BUFFER, 3);
|
||||
OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));
|
||||
OUT_RING(ring, upper_32_bits(submit->cmd[i].iova));
|
||||
OUT_RING(ring, submit->cmd[i].size);
|
||||
OUT_RING(ring, A5XX_CP_INDIRECT_BUFFER_2_IB_SIZE(submit->cmd[i].size));
|
||||
ibs++;
|
||||
break;
|
||||
}
|
||||
@@ -377,10 +377,10 @@ static void a7xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
|
||||
break;
|
||||
fallthrough;
|
||||
case MSM_SUBMIT_CMD_BUF:
|
||||
OUT_PKT7(ring, CP_INDIRECT_BUFFER_PFE, 3);
|
||||
OUT_PKT7(ring, CP_INDIRECT_BUFFER, 3);
|
||||
OUT_RING(ring, lower_32_bits(submit->cmd[i].iova));
|
||||
OUT_RING(ring, upper_32_bits(submit->cmd[i].iova));
|
||||
OUT_RING(ring, submit->cmd[i].size);
|
||||
OUT_RING(ring, A5XX_CP_INDIRECT_BUFFER_2_IB_SIZE(submit->cmd[i].size));
|
||||
ibs++;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -132,7 +132,6 @@ static const struct dpu_intf_cfg msm8937_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 14,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_2", .id = INTF_2,
|
||||
.base = 0x6b000, .len = 0x268,
|
||||
@@ -141,7 +140,6 @@ static const struct dpu_intf_cfg msm8937_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 14,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -118,7 +118,6 @@ static const struct dpu_intf_cfg msm8917_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 14,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -131,7 +131,6 @@ static const struct dpu_intf_cfg msm8953_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 14,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_1", .id = INTF_1,
|
||||
.base = 0x6a800, .len = 0x268,
|
||||
@@ -140,7 +139,6 @@ static const struct dpu_intf_cfg msm8953_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 14,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_2", .id = INTF_2,
|
||||
.base = 0x6b000, .len = 0x268,
|
||||
@@ -149,7 +147,6 @@ static const struct dpu_intf_cfg msm8953_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 14,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -241,7 +241,6 @@ static const struct dpu_intf_cfg msm8996_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 25,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_1", .id = INTF_1,
|
||||
.base = 0x6a800, .len = 0x268,
|
||||
@@ -250,7 +249,6 @@ static const struct dpu_intf_cfg msm8996_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 25,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_2", .id = INTF_2,
|
||||
.base = 0x6b000, .len = 0x268,
|
||||
@@ -259,7 +257,6 @@ static const struct dpu_intf_cfg msm8996_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 25,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_3", .id = INTF_3,
|
||||
.base = 0x6b800, .len = 0x268,
|
||||
@@ -267,7 +264,6 @@ static const struct dpu_intf_cfg msm8996_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 25,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 30),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 31),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -202,7 +202,6 @@ static const struct dpu_intf_cfg sdm660_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 21,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_1", .id = INTF_1,
|
||||
.base = 0x6a800, .len = 0x280,
|
||||
@@ -211,7 +210,6 @@ static const struct dpu_intf_cfg sdm660_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 21,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_2", .id = INTF_2,
|
||||
.base = 0x6b000, .len = 0x280,
|
||||
@@ -220,7 +218,6 @@ static const struct dpu_intf_cfg sdm660_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 21,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 28),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 29),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -147,7 +147,6 @@ static const struct dpu_intf_cfg sdm630_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 21,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 24),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 25),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
}, {
|
||||
.name = "intf_1", .id = INTF_1,
|
||||
.base = 0x6a800, .len = 0x280,
|
||||
@@ -156,7 +155,6 @@ static const struct dpu_intf_cfg sdm630_intf[] = {
|
||||
.prog_fetch_lines_worst_case = 21,
|
||||
.intr_underrun = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 26),
|
||||
.intr_vsync = DPU_IRQ_IDX(MDP_SSPP_TOP0_INTR, 27),
|
||||
.intr_tear_rd_ptr = -1,
|
||||
},
|
||||
};
|
||||
|
||||
|
||||
@@ -1666,7 +1666,7 @@ static void _dpu_encoder_trigger_flush(struct drm_encoder *drm_enc,
|
||||
*/
|
||||
static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys)
|
||||
{
|
||||
struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(phys->parent);
|
||||
struct dpu_encoder_virt *dpu_enc;
|
||||
|
||||
if (!phys) {
|
||||
DPU_ERROR("invalid argument(s)\n");
|
||||
@@ -1678,6 +1678,8 @@ static void _dpu_encoder_trigger_start(struct dpu_encoder_phys *phys)
|
||||
return;
|
||||
}
|
||||
|
||||
dpu_enc = to_dpu_encoder_virt(phys->parent);
|
||||
|
||||
if (phys->parent->encoder_type == DRM_MODE_ENCODER_VIRTUAL &&
|
||||
dpu_enc->cwb_mask) {
|
||||
DPU_DEBUG("encoder %d CWB enabled, skipping\n", DRMID(phys->parent));
|
||||
|
||||
@@ -729,12 +729,40 @@ static int dpu_plane_check_inline_rotation(struct dpu_plane *pdpu,
|
||||
static int dpu_plane_atomic_check_pipe(struct dpu_plane *pdpu,
|
||||
struct dpu_sw_pipe *pipe,
|
||||
struct dpu_sw_pipe_cfg *pipe_cfg,
|
||||
const struct msm_format *fmt,
|
||||
const struct drm_display_mode *mode)
|
||||
const struct drm_display_mode *mode,
|
||||
struct drm_plane_state *new_plane_state)
|
||||
{
|
||||
uint32_t min_src_size;
|
||||
struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
|
||||
int ret;
|
||||
const struct msm_format *fmt;
|
||||
uint32_t supported_rotations;
|
||||
const struct dpu_sspp_cfg *pipe_hw_caps;
|
||||
const struct dpu_sspp_sub_blks *sblk;
|
||||
|
||||
pipe_hw_caps = pipe->sspp->cap;
|
||||
sblk = pipe->sspp->cap->sblk;
|
||||
|
||||
/*
|
||||
* We already have verified scaling against platform limitations.
|
||||
* Now check if the SSPP supports scaling at all.
|
||||
*/
|
||||
if (!sblk->scaler_blk.len &&
|
||||
((drm_rect_width(&new_plane_state->src) >> 16 !=
|
||||
drm_rect_width(&new_plane_state->dst)) ||
|
||||
(drm_rect_height(&new_plane_state->src) >> 16 !=
|
||||
drm_rect_height(&new_plane_state->dst))))
|
||||
return -ERANGE;
|
||||
|
||||
fmt = msm_framebuffer_format(new_plane_state->fb);
|
||||
|
||||
supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0;
|
||||
|
||||
if (pipe_hw_caps->features & BIT(DPU_SSPP_INLINE_ROTATION))
|
||||
supported_rotations |= DRM_MODE_ROTATE_90;
|
||||
|
||||
pipe_cfg->rotation = drm_rotation_simplify(new_plane_state->rotation,
|
||||
supported_rotations);
|
||||
|
||||
min_src_size = MSM_FORMAT_IS_YUV(fmt) ? 2 : 1;
|
||||
|
||||
@@ -923,47 +951,20 @@ static int dpu_plane_atomic_check_sspp(struct drm_plane *plane,
|
||||
struct dpu_plane_state *pstate = to_dpu_plane_state(new_plane_state);
|
||||
struct dpu_sw_pipe *pipe = &pstate->pipe;
|
||||
struct dpu_sw_pipe *r_pipe = &pstate->r_pipe;
|
||||
const struct msm_format *fmt;
|
||||
struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg;
|
||||
struct dpu_sw_pipe_cfg *r_pipe_cfg = &pstate->r_pipe_cfg;
|
||||
uint32_t supported_rotations;
|
||||
const struct dpu_sspp_cfg *pipe_hw_caps;
|
||||
const struct dpu_sspp_sub_blks *sblk;
|
||||
int ret = 0;
|
||||
|
||||
pipe_hw_caps = pipe->sspp->cap;
|
||||
sblk = pipe->sspp->cap->sblk;
|
||||
|
||||
/*
|
||||
* We already have verified scaling against platform limitations.
|
||||
* Now check if the SSPP supports scaling at all.
|
||||
*/
|
||||
if (!sblk->scaler_blk.len &&
|
||||
((drm_rect_width(&new_plane_state->src) >> 16 !=
|
||||
drm_rect_width(&new_plane_state->dst)) ||
|
||||
(drm_rect_height(&new_plane_state->src) >> 16 !=
|
||||
drm_rect_height(&new_plane_state->dst))))
|
||||
return -ERANGE;
|
||||
|
||||
fmt = msm_framebuffer_format(new_plane_state->fb);
|
||||
|
||||
supported_rotations = DRM_MODE_REFLECT_MASK | DRM_MODE_ROTATE_0;
|
||||
|
||||
if (pipe_hw_caps->features & BIT(DPU_SSPP_INLINE_ROTATION))
|
||||
supported_rotations |= DRM_MODE_ROTATE_90;
|
||||
|
||||
pipe_cfg->rotation = drm_rotation_simplify(new_plane_state->rotation,
|
||||
supported_rotations);
|
||||
r_pipe_cfg->rotation = pipe_cfg->rotation;
|
||||
|
||||
ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt,
|
||||
&crtc_state->adjusted_mode);
|
||||
ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg,
|
||||
&crtc_state->adjusted_mode,
|
||||
new_plane_state);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (drm_rect_width(&r_pipe_cfg->src_rect) != 0) {
|
||||
ret = dpu_plane_atomic_check_pipe(pdpu, r_pipe, r_pipe_cfg, fmt,
|
||||
&crtc_state->adjusted_mode);
|
||||
ret = dpu_plane_atomic_check_pipe(pdpu, r_pipe, r_pipe_cfg,
|
||||
&crtc_state->adjusted_mode,
|
||||
new_plane_state);
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
@@ -1059,6 +1060,9 @@ static int dpu_plane_virtual_atomic_check(struct drm_plane *plane,
|
||||
struct drm_crtc_state *crtc_state;
|
||||
int ret;
|
||||
|
||||
if (IS_ERR(plane_state))
|
||||
return PTR_ERR(plane_state);
|
||||
|
||||
if (plane_state->crtc)
|
||||
crtc_state = drm_atomic_get_new_crtc_state(state,
|
||||
plane_state->crtc);
|
||||
|
||||
@@ -2259,5 +2259,12 @@ opcode: CP_LOAD_STATE4 (30) (4 dwords)
|
||||
</reg32>
|
||||
</domain>
|
||||
|
||||
<domain name="CP_INDIRECT_BUFFER" width="32" varset="chip" prefix="chip" variants="A5XX-">
|
||||
<reg64 offset="0" name="IB_BASE" type="address"/>
|
||||
<reg32 offset="2" name="2">
|
||||
<bitfield name="IB_SIZE" low="0" high="19"/>
|
||||
</reg32>
|
||||
</domain>
|
||||
|
||||
</database>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user