Skip to content

Commit a2ce3f7

Browse files
committed
Merge tag 'drm-misc-fixes-2024-05-30' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
Short summary of fixes pull: dma-buf: - sw-sync: Don't interfere with IRQ handling - Fix kthreads-handling error path gem-shmem: - Warn when trying to pin imported objects lima: - Fix dma_resv-related deadlock in object pin msm: - Remove build-time dependency on Python 3.9 nouveau: - nvif: Fix possible integer overflow panel: - lg-sw43408: Select DP helpers; Declare backlight ops as static - sitronix-st7789v: Various fixes for jt240mhqs_hwt_ek_e3 panel panfrost: - Fix dma_resv-related deadlock in object pin Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patchwork.freedesktop.org/patch/msgid/20240530192307.GA14809@localhost.localdomain
2 parents bb61cf4 + bb19535 commit a2ce3f7

File tree

10 files changed

+44
-21
lines changed

10 files changed

+44
-21
lines changed

drivers/dma-buf/st-dma-fence.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,12 @@ static int race_signal_callback(void *arg)
540540
t[i].before = pass;
541541
t[i].task = kthread_run(thread_signal_callback, &t[i],
542542
"dma-fence:%d", i);
543+
if (IS_ERR(t[i].task)) {
544+
ret = PTR_ERR(t[i].task);
545+
while (--i >= 0)
546+
kthread_stop_put(t[i].task);
547+
return ret;
548+
}
543549
get_task_struct(t[i].task);
544550
}
545551

drivers/dma-buf/sync_debug.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
110110

111111
seq_printf(s, "%s: %d\n", obj->name, obj->value);
112112

113-
spin_lock_irq(&obj->lock);
113+
spin_lock(&obj->lock); /* Caller already disabled IRQ. */
114114
list_for_each(pos, &obj->pt_list) {
115115
struct sync_pt *pt = container_of(pos, struct sync_pt, link);
116116
sync_print_fence(s, &pt->base, false);
117117
}
118-
spin_unlock_irq(&obj->lock);
118+
spin_unlock(&obj->lock);
119119
}
120120

121121
static void sync_print_sync_file(struct seq_file *s,

drivers/gpu/drm/drm_gem_shmem_helper.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem)
233233

234234
dma_resv_assert_held(shmem->base.resv);
235235

236+
drm_WARN_ON(shmem->base.dev, shmem->base.import_attach);
237+
236238
ret = drm_gem_shmem_get_pages(shmem);
237239

238240
return ret;

drivers/gpu/drm/lima/lima_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj)
185185
if (bo->heap_size)
186186
return -EINVAL;
187187

188-
return drm_gem_shmem_pin(&bo->base);
188+
return drm_gem_shmem_pin_locked(&bo->base);
189189
}
190190

191191
static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)

drivers/gpu/drm/msm/registers/gen_header.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ def add_all_usages(self, reg, usages):
538538
self.variants.add(reg.domain)
539539

540540
def do_validate(self, schemafile):
541-
if self.validate == False:
541+
if not self.validate:
542542
return
543543

544544
try:
@@ -948,7 +948,8 @@ def main():
948948
parser = argparse.ArgumentParser()
949949
parser.add_argument('--rnn', type=str, required=True)
950950
parser.add_argument('--xml', type=str, required=True)
951-
parser.add_argument('--validate', action=argparse.BooleanOptionalAction)
951+
parser.add_argument('--validate', default=False, action='store_true')
952+
parser.add_argument('--no-validate', dest='validate', action='store_false')
952953

953954
subparsers = parser.add_subparsers()
954955
subparsers.required = True

drivers/gpu/drm/nouveau/nvif/object.c

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,11 +142,16 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size)
142142
struct nvif_ioctl_v0 ioctl;
143143
struct nvif_ioctl_mthd_v0 mthd;
144144
} *args;
145+
u32 args_size;
145146
u8 stack[128];
146147
int ret;
147148

148-
if (sizeof(*args) + size > sizeof(stack)) {
149-
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL)))
149+
if (check_add_overflow(sizeof(*args), size, &args_size))
150+
return -ENOMEM;
151+
152+
if (args_size > sizeof(stack)) {
153+
args = kmalloc(args_size, GFP_KERNEL);
154+
if (!args)
150155
return -ENOMEM;
151156
} else {
152157
args = (void *)stack;
@@ -157,7 +162,7 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size)
157162
args->mthd.method = mthd;
158163

159164
memcpy(args->mthd.data, data, size);
160-
ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL);
165+
ret = nvif_object_ioctl(object, args, args_size, NULL);
161166
memcpy(data, args->mthd.data, size);
162167
if (args != (void *)stack)
163168
kfree(args);
@@ -276,7 +281,15 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
276281
object->map.size = 0;
277282

278283
if (parent) {
279-
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) {
284+
u32 args_size;
285+
286+
if (check_add_overflow(sizeof(*args), size, &args_size)) {
287+
nvif_object_dtor(object);
288+
return -ENOMEM;
289+
}
290+
291+
args = kmalloc(args_size, GFP_KERNEL);
292+
if (!args) {
280293
nvif_object_dtor(object);
281294
return -ENOMEM;
282295
}
@@ -293,8 +306,7 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
293306
args->new.oclass = oclass;
294307

295308
memcpy(args->new.data, data, size);
296-
ret = nvif_object_ioctl(parent, args, sizeof(*args) + size,
297-
&object->priv);
309+
ret = nvif_object_ioctl(parent, args, args_size, &object->priv);
298310
memcpy(data, args->new.data, size);
299311
kfree(args);
300312
if (ret == 0)

drivers/gpu/drm/panel/Kconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,8 @@ config DRM_PANEL_LG_SW43408
340340
depends on OF
341341
depends on DRM_MIPI_DSI
342342
depends on BACKLIGHT_CLASS_DEVICE
343+
select DRM_DISPLAY_DP_HELPER
344+
select DRM_DISPLAY_HELPER
343345
help
344346
Say Y here if you want to enable support for LG sw43408 panel.
345347
The panel has a 1080x2160@60Hz resolution and uses 24 bit RGB per

drivers/gpu/drm/panel/panel-lg-sw43408.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ static int sw43408_backlight_update_status(struct backlight_device *bl)
182182
return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
183183
}
184184

185-
const struct backlight_ops sw43408_backlight_ops = {
185+
static const struct backlight_ops sw43408_backlight_ops = {
186186
.update_status = sw43408_backlight_update_status,
187187
};
188188

drivers/gpu/drm/panel/panel-sitronix-st7789v.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -282,15 +282,15 @@ static const struct drm_display_mode et028013dma_mode = {
282282
static const struct drm_display_mode jt240mhqs_hwt_ek_e3_mode = {
283283
.clock = 6000,
284284
.hdisplay = 240,
285-
.hsync_start = 240 + 28,
286-
.hsync_end = 240 + 28 + 10,
287-
.htotal = 240 + 28 + 10 + 10,
285+
.hsync_start = 240 + 38,
286+
.hsync_end = 240 + 38 + 10,
287+
.htotal = 240 + 38 + 10 + 10,
288288
.vdisplay = 280,
289-
.vsync_start = 280 + 8,
290-
.vsync_end = 280 + 8 + 4,
291-
.vtotal = 280 + 8 + 4 + 4,
292-
.width_mm = 43,
293-
.height_mm = 37,
289+
.vsync_start = 280 + 48,
290+
.vsync_end = 280 + 48 + 4,
291+
.vtotal = 280 + 48 + 4 + 4,
292+
.width_mm = 37,
293+
.height_mm = 43,
294294
.flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
295295
};
296296

drivers/gpu/drm/panfrost/panfrost_gem.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ static int panfrost_gem_pin(struct drm_gem_object *obj)
192192
if (bo->is_heap)
193193
return -EINVAL;
194194

195-
return drm_gem_shmem_pin(&bo->base);
195+
return drm_gem_shmem_pin_locked(&bo->base);
196196
}
197197

198198
static enum drm_gem_object_status panfrost_gem_status(struct drm_gem_object *obj)

0 commit comments

Comments
 (0)