Skip to content

Commit 3a43e30

Browse files
committed
Merge tag 'drm-msm-fixes-2023-03-09' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
msm-fixes for v6.3-rc2 - Fix for possible invalid ptr free in submit ioctl syncobj cleanup path. - Synchronize GMU removal in driver teardown path - a5xx preemption fixes - Fix runpm imbalance at unbind - DPU hw catalog fixes: - set DPU_MDP_PERIPH_0_REMOVED for sc8280xp as this is another chipset where the PERIPH_0 block of registers is not there - fix the DPU features supported in QCM2290 by comparing it with the downstream device tree - fix the length of registers in the sc7180_ctl from 0xe4 to 0x1dc - fix the max mixer line width for sm6115 and qcm2290 chipsets in the DPU catalog - fix the scaler version on sm8550, sc8280xp, sm8450, sm8250, sm8350 and sm6115. This was incorrectly populated on the SW version of the scaler library and not the scaler HW version - Drop dim layer support for msm8998 as its not indicated to be supported in the downstream DTSI - fix the DPU_CLK_CTRL bits for msm 8998 sspp blocks - Use DPU_CLK_CTRL_DMA* prefix instead of DPU_CLK_CTRL_CURSOR* for all chipsets for the DMA sspp blocks - fix the ping-pong block base address for sc7280 in the DPU HW catalog - Fix stack corruption issue in the dpu_hw_ctl_setup_blendstage() function as it was causing a negative left shift by protecting against an invalid index - Clear the DSPP reservations in dpu_rm_release(). This was missed out and as as result the DSPP was not released from the resource manager global state. Signed-off-by: Dave Airlie <[email protected]> From: Rob Clark <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvH+VH_Wx3mFMG51CMnoiU06CM-+-WMhM73M42Qx7Bp4A@mail.gmail.com
2 parents b2bda46 + a722511 commit 3a43e30

File tree

11 files changed

+101
-96
lines changed

11 files changed

+101
-96
lines changed

drivers/gpu/drm/msm/Kconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ config DRM_MSM
2323
select SHMEM
2424
select TMPFS
2525
select QCOM_SCM
26-
select DEVFREQ_GOV_SIMPLE_ONDEMAND
2726
select WANT_DEV_COREDUMP
2827
select SND_SOC_HDMI_CODEC if SND_SOC
2928
select SYNC_FILE

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ static void a5xx_submit(struct msm_gpu *gpu, struct msm_gem_submit *submit)
151151
OUT_RING(ring, 1);
152152

153153
/* Enable local preemption for finegrain preemption */
154-
OUT_PKT7(ring, CP_PREEMPT_ENABLE_GLOBAL, 1);
155-
OUT_RING(ring, 0x02);
154+
OUT_PKT7(ring, CP_PREEMPT_ENABLE_LOCAL, 1);
155+
OUT_RING(ring, 0x1);
156156

157157
/* Allow CP_CONTEXT_SWITCH_YIELD packets in the IB2 */
158158
OUT_PKT7(ring, CP_YIELD_ENABLE, 1);
@@ -806,7 +806,7 @@ static int a5xx_hw_init(struct msm_gpu *gpu)
806806
gpu_write(gpu, REG_A5XX_RBBM_AHB_CNTL2, 0x0000003F);
807807

808808
/* Set the highest bank bit */
809-
if (adreno_is_a540(adreno_gpu))
809+
if (adreno_is_a540(adreno_gpu) || adreno_is_a530(adreno_gpu))
810810
regbit = 2;
811811
else
812812
regbit = 1;

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ static struct msm_ringbuffer *get_next_ring(struct msm_gpu *gpu)
6363
struct msm_ringbuffer *ring = gpu->rb[i];
6464

6565
spin_lock_irqsave(&ring->preempt_lock, flags);
66-
empty = (get_wptr(ring) == ring->memptrs->rptr);
66+
empty = (get_wptr(ring) == gpu->funcs->get_rptr(gpu, ring));
6767
spin_unlock_irqrestore(&ring->preempt_lock, flags);
6868

6969
if (!empty)
@@ -207,6 +207,7 @@ void a5xx_preempt_hw_init(struct msm_gpu *gpu)
207207
a5xx_gpu->preempt[i]->wptr = 0;
208208
a5xx_gpu->preempt[i]->rptr = 0;
209209
a5xx_gpu->preempt[i]->rbase = gpu->rb[i]->iova;
210+
a5xx_gpu->preempt[i]->rptr_addr = shadowptr(a5xx_gpu, gpu->rb[i]);
210211
}
211212

212213
/* Write a 0 to signal that we aren't switching pagetables */
@@ -257,7 +258,6 @@ static int preempt_init_ring(struct a5xx_gpu *a5xx_gpu,
257258
ptr->data = 0;
258259
ptr->cntl = MSM_GPU_RB_CNTL_DEFAULT | AXXX_CP_RB_CNTL_NO_UPDATE;
259260

260-
ptr->rptr_addr = shadowptr(a5xx_gpu, ring);
261261
ptr->counter = counters_iova;
262262

263263
return 0;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ int a6xx_gmu_resume(struct a6xx_gpu *a6xx_gpu)
974974
int status, ret;
975975

976976
if (WARN(!gmu->initialized, "The GMU is not set up yet\n"))
977-
return 0;
977+
return -EINVAL;
978978

979979
gmu->hung = false;
980980

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1746,7 +1746,9 @@ static void a6xx_destroy(struct msm_gpu *gpu)
17461746

17471747
a6xx_llc_slices_destroy(a6xx_gpu);
17481748

1749+
mutex_lock(&a6xx_gpu->gmu.lock);
17491750
a6xx_gmu_remove(a6xx_gpu);
1751+
mutex_unlock(&a6xx_gpu->gmu.lock);
17501752

17511753
adreno_gpu_cleanup(adreno_gpu);
17521754

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,8 @@ static void adreno_unbind(struct device *dev, struct device *master,
558558
struct msm_drm_private *priv = dev_get_drvdata(master);
559559
struct msm_gpu *gpu = dev_to_gpu(dev);
560560

561-
WARN_ON_ONCE(adreno_system_suspend(dev));
561+
if (pm_runtime_enabled(dev))
562+
WARN_ON_ONCE(adreno_system_suspend(dev));
562563
gpu->funcs->destroy(gpu);
563564

564565
priv->gpu_pdev = NULL;

0 commit comments

Comments
 (0)