Skip to content

Commit f0e7ce1

Browse files
committed
Merge tag 'drm-msm-fixes-2019-01-24' of git://people.freedesktop.org/~robclark/linux into drm-fixes
A few fixes for v5.0.. the opp-level fix and removal of hard-coded irq name is partially to make things smoother in v5.1 merge window to avoid dependency on drm vs dt trees, but are otherwise sane changes. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Rob Clark <robdclark@gmail.com> Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGsAEHd2tGRQxRTs+A-8y_tthPs2iUgCCCEwR5vDMXab4A@mail.gmail.com
2 parents 7325e4b + a840f69 commit f0e7ce1

File tree

10 files changed

+36
-25
lines changed

10 files changed

+36
-25
lines changed

Documentation/devicetree/bindings/display/msm/gpu.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Example:
2727
reg = <0x04300000 0x20000>;
2828
reg-names = "kgsl_3d0_reg_memory";
2929
interrupts = <GIC_SPI 80 0>;
30-
interrupt-names = "kgsl_3d0_irq";
3130
clock-names =
3231
"core",
3332
"iface",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -944,7 +944,7 @@ static u32 a6xx_gmu_get_arc_level(struct device *dev, unsigned long freq)
944944
np = dev_pm_opp_get_of_node(opp);
945945

946946
if (np) {
947-
of_property_read_u32(np, "qcom,level", &val);
947+
of_property_read_u32(np, "opp-level", &val);
948948
of_node_put(np);
949949
}
950950

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,6 @@ int adreno_gpu_init(struct drm_device *drm, struct platform_device *pdev,
765765
adreno_gpu->rev = config->rev;
766766

767767
adreno_gpu_config.ioname = "kgsl_3d0_reg_memory";
768-
adreno_gpu_config.irqname = "kgsl_3d0_irq";
769768

770769
adreno_gpu_config.va_start = SZ_16M;
771770
adreno_gpu_config.va_end = 0xffffffff;

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -365,19 +365,6 @@ static void _dpu_plane_set_qos_ctrl(struct drm_plane *plane,
365365
&pdpu->pipe_qos_cfg);
366366
}
367367

368-
static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
369-
{
370-
struct dpu_plane *pdpu = to_dpu_plane(plane);
371-
struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
372-
373-
if (!pdpu->is_rt_pipe)
374-
return;
375-
376-
pm_runtime_get_sync(&dpu_kms->pdev->dev);
377-
_dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
378-
pm_runtime_put_sync(&dpu_kms->pdev->dev);
379-
}
380-
381368
/**
382369
* _dpu_plane_set_ot_limit - set OT limit for the given plane
383370
* @plane: Pointer to drm plane
@@ -1248,6 +1235,19 @@ static void dpu_plane_reset(struct drm_plane *plane)
12481235
}
12491236

12501237
#ifdef CONFIG_DEBUG_FS
1238+
static void dpu_plane_danger_signal_ctrl(struct drm_plane *plane, bool enable)
1239+
{
1240+
struct dpu_plane *pdpu = to_dpu_plane(plane);
1241+
struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
1242+
1243+
if (!pdpu->is_rt_pipe)
1244+
return;
1245+
1246+
pm_runtime_get_sync(&dpu_kms->pdev->dev);
1247+
_dpu_plane_set_qos_ctrl(plane, enable, DPU_PLANE_QOS_PANIC_CTRL);
1248+
pm_runtime_put_sync(&dpu_kms->pdev->dev);
1249+
}
1250+
12511251
static ssize_t _dpu_plane_danger_read(struct file *file,
12521252
char __user *buff, size_t count, loff_t *ppos)
12531253
{

drivers/gpu/drm/msm/msm_drv.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,8 @@ void msm_gem_purge_vma(struct msm_gem_address_space *aspace,
250250
void msm_gem_unmap_vma(struct msm_gem_address_space *aspace,
251251
struct msm_gem_vma *vma);
252252
int msm_gem_map_vma(struct msm_gem_address_space *aspace,
253-
struct msm_gem_vma *vma, struct sg_table *sgt, int npages);
253+
struct msm_gem_vma *vma, int prot,
254+
struct sg_table *sgt, int npages);
254255
void msm_gem_close_vma(struct msm_gem_address_space *aspace,
255256
struct msm_gem_vma *vma);
256257

@@ -333,6 +334,7 @@ void msm_gem_kernel_put(struct drm_gem_object *bo,
333334
struct drm_gem_object *msm_gem_import(struct drm_device *dev,
334335
struct dma_buf *dmabuf, struct sg_table *sgt);
335336

337+
__printf(2, 3)
336338
void msm_gem_object_set_name(struct drm_gem_object *bo, const char *fmt, ...);
337339

338340
int msm_framebuffer_prepare(struct drm_framebuffer *fb,
@@ -396,12 +398,14 @@ void msm_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m);
396398
int msm_debugfs_late_init(struct drm_device *dev);
397399
int msm_rd_debugfs_init(struct drm_minor *minor);
398400
void msm_rd_debugfs_cleanup(struct msm_drm_private *priv);
401+
__printf(3, 4)
399402
void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
400403
const char *fmt, ...);
401404
int msm_perf_debugfs_init(struct drm_minor *minor);
402405
void msm_perf_debugfs_cleanup(struct msm_drm_private *priv);
403406
#else
404407
static inline int msm_debugfs_late_init(struct drm_device *dev) { return 0; }
408+
__printf(3, 4)
405409
static inline void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
406410
const char *fmt, ...) {}
407411
static inline void msm_rd_debugfs_cleanup(struct msm_drm_private *priv) {}

drivers/gpu/drm/msm/msm_gem.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,10 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj,
391391
struct msm_gem_object *msm_obj = to_msm_bo(obj);
392392
struct msm_gem_vma *vma;
393393
struct page **pages;
394+
int prot = IOMMU_READ;
395+
396+
if (!(msm_obj->flags & MSM_BO_GPU_READONLY))
397+
prot |= IOMMU_WRITE;
394398

395399
WARN_ON(!mutex_is_locked(&msm_obj->lock));
396400

@@ -405,8 +409,8 @@ static int msm_gem_pin_iova(struct drm_gem_object *obj,
405409
if (IS_ERR(pages))
406410
return PTR_ERR(pages);
407411

408-
return msm_gem_map_vma(aspace, vma, msm_obj->sgt,
409-
obj->size >> PAGE_SHIFT);
412+
return msm_gem_map_vma(aspace, vma, prot,
413+
msm_obj->sgt, obj->size >> PAGE_SHIFT);
410414
}
411415

412416
/* get iova and pin it. Should have a matching put */

drivers/gpu/drm/msm/msm_gem_vma.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@ void msm_gem_unmap_vma(struct msm_gem_address_space *aspace,
6868

6969
int
7070
msm_gem_map_vma(struct msm_gem_address_space *aspace,
71-
struct msm_gem_vma *vma, struct sg_table *sgt, int npages)
71+
struct msm_gem_vma *vma, int prot,
72+
struct sg_table *sgt, int npages)
7273
{
7374
unsigned size = npages << PAGE_SHIFT;
7475
int ret = 0;
@@ -86,7 +87,7 @@ msm_gem_map_vma(struct msm_gem_address_space *aspace,
8687

8788
if (aspace->mmu)
8889
ret = aspace->mmu->funcs->map(aspace->mmu, vma->iova, sgt,
89-
size, IOMMU_READ | IOMMU_WRITE);
90+
size, prot);
9091

9192
if (ret)
9293
vma->mapped = false;

drivers/gpu/drm/msm/msm_gpu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ int msm_gpu_init(struct drm_device *drm, struct platform_device *pdev,
900900
}
901901

902902
/* Get Interrupt: */
903-
gpu->irq = platform_get_irq_byname(pdev, config->irqname);
903+
gpu->irq = platform_get_irq(pdev, 0);
904904
if (gpu->irq < 0) {
905905
ret = gpu->irq;
906906
DRM_DEV_ERROR(drm->dev, "failed to get irq: %d\n", ret);

drivers/gpu/drm/msm/msm_gpu.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ struct msm_gpu_state;
3131

3232
struct msm_gpu_config {
3333
const char *ioname;
34-
const char *irqname;
3534
uint64_t va_start;
3635
uint64_t va_end;
3736
unsigned int nr_rings;
@@ -63,7 +62,7 @@ struct msm_gpu_funcs {
6362
struct msm_ringbuffer *(*active_ring)(struct msm_gpu *gpu);
6463
void (*recover)(struct msm_gpu *gpu);
6564
void (*destroy)(struct msm_gpu *gpu);
66-
#ifdef CONFIG_DEBUG_FS
65+
#if defined(CONFIG_DEBUG_FS) || defined(CONFIG_DEV_COREDUMP)
6766
/* show GPU status in debugfs: */
6867
void (*show)(struct msm_gpu *gpu, struct msm_gpu_state *state,
6968
struct drm_printer *p);

drivers/gpu/drm/msm/msm_rd.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
115115
char *fptr = &fifo->buf[fifo->head];
116116
int n;
117117

118-
wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0);
118+
wait_event(rd->fifo_event, circ_space(&rd->fifo) > 0 || !rd->open);
119+
if (!rd->open)
120+
return;
119121

120122
/* Note that smp_load_acquire() is not strictly required
121123
* as CIRC_SPACE_TO_END() does not access the tail more
@@ -213,7 +215,10 @@ static int rd_open(struct inode *inode, struct file *file)
213215
static int rd_release(struct inode *inode, struct file *file)
214216
{
215217
struct msm_rd_state *rd = inode->i_private;
218+
216219
rd->open = false;
220+
wake_up_all(&rd->fifo_event);
221+
217222
return 0;
218223
}
219224

0 commit comments

Comments
 (0)