Commit a2ce3f77 authored by Dave Airlie's avatar Dave Airlie

Merge tag 'drm-misc-fixes-2024-05-30' of...

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: default avatarDave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20240530192307.GA14809@localhost.localdomain
parents bb61cf46 bb195358
...@@ -540,6 +540,12 @@ static int race_signal_callback(void *arg) ...@@ -540,6 +540,12 @@ static int race_signal_callback(void *arg)
t[i].before = pass; t[i].before = pass;
t[i].task = kthread_run(thread_signal_callback, &t[i], t[i].task = kthread_run(thread_signal_callback, &t[i],
"dma-fence:%d", i); "dma-fence:%d", i);
if (IS_ERR(t[i].task)) {
ret = PTR_ERR(t[i].task);
while (--i >= 0)
kthread_stop_put(t[i].task);
return ret;
}
get_task_struct(t[i].task); get_task_struct(t[i].task);
} }
......
...@@ -110,12 +110,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj) ...@@ -110,12 +110,12 @@ static void sync_print_obj(struct seq_file *s, struct sync_timeline *obj)
seq_printf(s, "%s: %d\n", obj->name, obj->value); seq_printf(s, "%s: %d\n", obj->name, obj->value);
spin_lock_irq(&obj->lock); spin_lock(&obj->lock); /* Caller already disabled IRQ. */
list_for_each(pos, &obj->pt_list) { list_for_each(pos, &obj->pt_list) {
struct sync_pt *pt = container_of(pos, struct sync_pt, link); struct sync_pt *pt = container_of(pos, struct sync_pt, link);
sync_print_fence(s, &pt->base, false); sync_print_fence(s, &pt->base, false);
} }
spin_unlock_irq(&obj->lock); spin_unlock(&obj->lock);
} }
static void sync_print_sync_file(struct seq_file *s, static void sync_print_sync_file(struct seq_file *s,
......
...@@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem) ...@@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem)
dma_resv_assert_held(shmem->base.resv); dma_resv_assert_held(shmem->base.resv);
drm_WARN_ON(shmem->base.dev, shmem->base.import_attach);
ret = drm_gem_shmem_get_pages(shmem); ret = drm_gem_shmem_get_pages(shmem);
return ret; return ret;
......
...@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj) ...@@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj)
if (bo->heap_size) if (bo->heap_size)
return -EINVAL; return -EINVAL;
return drm_gem_shmem_pin(&bo->base); return drm_gem_shmem_pin_locked(&bo->base);
} }
static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map) static int lima_gem_vmap(struct drm_gem_object *obj, struct iosys_map *map)
......
...@@ -538,7 +538,7 @@ class Parser(object): ...@@ -538,7 +538,7 @@ class Parser(object):
self.variants.add(reg.domain) self.variants.add(reg.domain)
def do_validate(self, schemafile): def do_validate(self, schemafile):
if self.validate == False: if not self.validate:
return return
try: try:
...@@ -948,7 +948,8 @@ def main(): ...@@ -948,7 +948,8 @@ def main():
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('--rnn', type=str, required=True) parser.add_argument('--rnn', type=str, required=True)
parser.add_argument('--xml', type=str, required=True) parser.add_argument('--xml', type=str, required=True)
parser.add_argument('--validate', action=argparse.BooleanOptionalAction) parser.add_argument('--validate', default=False, action='store_true')
parser.add_argument('--no-validate', dest='validate', action='store_false')
subparsers = parser.add_subparsers() subparsers = parser.add_subparsers()
subparsers.required = True subparsers.required = True
......
...@@ -142,11 +142,16 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size) ...@@ -142,11 +142,16 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size)
struct nvif_ioctl_v0 ioctl; struct nvif_ioctl_v0 ioctl;
struct nvif_ioctl_mthd_v0 mthd; struct nvif_ioctl_mthd_v0 mthd;
} *args; } *args;
u32 args_size;
u8 stack[128]; u8 stack[128];
int ret; int ret;
if (sizeof(*args) + size > sizeof(stack)) { if (check_add_overflow(sizeof(*args), size, &args_size))
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) return -ENOMEM;
if (args_size > sizeof(stack)) {
args = kmalloc(args_size, GFP_KERNEL);
if (!args)
return -ENOMEM; return -ENOMEM;
} else { } else {
args = (void *)stack; args = (void *)stack;
...@@ -157,7 +162,7 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size) ...@@ -157,7 +162,7 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size)
args->mthd.method = mthd; args->mthd.method = mthd;
memcpy(args->mthd.data, data, size); memcpy(args->mthd.data, data, size);
ret = nvif_object_ioctl(object, args, sizeof(*args) + size, NULL); ret = nvif_object_ioctl(object, args, args_size, NULL);
memcpy(data, args->mthd.data, size); memcpy(data, args->mthd.data, size);
if (args != (void *)stack) if (args != (void *)stack)
kfree(args); kfree(args);
...@@ -276,7 +281,15 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle, ...@@ -276,7 +281,15 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
object->map.size = 0; object->map.size = 0;
if (parent) { if (parent) {
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL))) { u32 args_size;
if (check_add_overflow(sizeof(*args), size, &args_size)) {
nvif_object_dtor(object);
return -ENOMEM;
}
args = kmalloc(args_size, GFP_KERNEL);
if (!args) {
nvif_object_dtor(object); nvif_object_dtor(object);
return -ENOMEM; return -ENOMEM;
} }
...@@ -293,8 +306,7 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle, ...@@ -293,8 +306,7 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
args->new.oclass = oclass; args->new.oclass = oclass;
memcpy(args->new.data, data, size); memcpy(args->new.data, data, size);
ret = nvif_object_ioctl(parent, args, sizeof(*args) + size, ret = nvif_object_ioctl(parent, args, args_size, &object->priv);
&object->priv);
memcpy(data, args->new.data, size); memcpy(data, args->new.data, size);
kfree(args); kfree(args);
if (ret == 0) if (ret == 0)
......
...@@ -340,6 +340,8 @@ config DRM_PANEL_LG_SW43408 ...@@ -340,6 +340,8 @@ config DRM_PANEL_LG_SW43408
depends on OF depends on OF
depends on DRM_MIPI_DSI depends on DRM_MIPI_DSI
depends on BACKLIGHT_CLASS_DEVICE depends on BACKLIGHT_CLASS_DEVICE
select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_HELPER
help help
Say Y here if you want to enable support for LG sw43408 panel. Say Y here if you want to enable support for LG sw43408 panel.
The panel has a 1080x2160@60Hz resolution and uses 24 bit RGB per The panel has a 1080x2160@60Hz resolution and uses 24 bit RGB per
......
...@@ -182,7 +182,7 @@ static int sw43408_backlight_update_status(struct backlight_device *bl) ...@@ -182,7 +182,7 @@ static int sw43408_backlight_update_status(struct backlight_device *bl)
return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness); return mipi_dsi_dcs_set_display_brightness_large(dsi, brightness);
} }
const struct backlight_ops sw43408_backlight_ops = { static const struct backlight_ops sw43408_backlight_ops = {
.update_status = sw43408_backlight_update_status, .update_status = sw43408_backlight_update_status,
}; };
......
...@@ -282,15 +282,15 @@ static const struct drm_display_mode et028013dma_mode = { ...@@ -282,15 +282,15 @@ static const struct drm_display_mode et028013dma_mode = {
static const struct drm_display_mode jt240mhqs_hwt_ek_e3_mode = { static const struct drm_display_mode jt240mhqs_hwt_ek_e3_mode = {
.clock = 6000, .clock = 6000,
.hdisplay = 240, .hdisplay = 240,
.hsync_start = 240 + 28, .hsync_start = 240 + 38,
.hsync_end = 240 + 28 + 10, .hsync_end = 240 + 38 + 10,
.htotal = 240 + 28 + 10 + 10, .htotal = 240 + 38 + 10 + 10,
.vdisplay = 280, .vdisplay = 280,
.vsync_start = 280 + 8, .vsync_start = 280 + 48,
.vsync_end = 280 + 8 + 4, .vsync_end = 280 + 48 + 4,
.vtotal = 280 + 8 + 4 + 4, .vtotal = 280 + 48 + 4 + 4,
.width_mm = 43, .width_mm = 37,
.height_mm = 37, .height_mm = 43,
.flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
}; };
......
...@@ -192,7 +192,7 @@ static int panfrost_gem_pin(struct drm_gem_object *obj) ...@@ -192,7 +192,7 @@ static int panfrost_gem_pin(struct drm_gem_object *obj)
if (bo->is_heap) if (bo->is_heap)
return -EINVAL; return -EINVAL;
return drm_gem_shmem_pin(&bo->base); return drm_gem_shmem_pin_locked(&bo->base);
} }
static enum drm_gem_object_status panfrost_gem_status(struct drm_gem_object *obj) static enum drm_gem_object_status panfrost_gem_status(struct drm_gem_object *obj)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment