Skip to content

Commit

Permalink
Merge tag 'drm-misc-fixes-2024-05-30' of https://gitlab.freedesktop.o…
Browse files Browse the repository at this point in the history
…rg/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 <[email protected]>

From: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
airlied committed May 31, 2024
2 parents bb61cf4 + bb19535 commit a2ce3f7
Show file tree
Hide file tree
Showing 10 changed files with 44 additions and 21 deletions.
6 changes: 6 additions & 0 deletions drivers/dma-buf/st-dma-fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,12 @@ static int race_signal_callback(void *arg)
t[i].before = pass;
t[i].task = kthread_run(thread_signal_callback, &t[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);
}

Expand Down
4 changes: 2 additions & 2 deletions drivers/dma-buf/sync_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

spin_lock_irq(&obj->lock);
spin_lock(&obj->lock); /* Caller already disabled IRQ. */
list_for_each(pos, &obj->pt_list) {
struct sync_pt *pt = container_of(pos, struct sync_pt, link);
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,
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/drm_gem_shmem_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ int drm_gem_shmem_pin_locked(struct drm_gem_shmem_object *shmem)

dma_resv_assert_held(shmem->base.resv);

drm_WARN_ON(shmem->base.dev, shmem->base.import_attach);

ret = drm_gem_shmem_get_pages(shmem);

return ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/lima/lima_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ static int lima_gem_pin(struct drm_gem_object *obj)
if (bo->heap_size)
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)
Expand Down
5 changes: 3 additions & 2 deletions drivers/gpu/drm/msm/registers/gen_header.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def add_all_usages(self, reg, usages):
self.variants.add(reg.domain)

def do_validate(self, schemafile):
if self.validate == False:
if not self.validate:
return

try:
Expand Down Expand Up @@ -948,7 +948,8 @@ def main():
parser = argparse.ArgumentParser()
parser.add_argument('--rnn', 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.required = True
Expand Down
24 changes: 18 additions & 6 deletions drivers/gpu/drm/nouveau/nvif/object.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_mthd_v0 mthd;
} *args;
u32 args_size;
u8 stack[128];
int ret;

if (sizeof(*args) + size > sizeof(stack)) {
if (!(args = kmalloc(sizeof(*args) + size, GFP_KERNEL)))
if (check_add_overflow(sizeof(*args), size, &args_size))
return -ENOMEM;

if (args_size > sizeof(stack)) {
args = kmalloc(args_size, GFP_KERNEL);
if (!args)
return -ENOMEM;
} else {
args = (void *)stack;
Expand All @@ -157,7 +162,7 @@ nvif_object_mthd(struct nvif_object *object, u32 mthd, void *data, u32 size)
args->mthd.method = mthd;

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);
if (args != (void *)stack)
kfree(args);
Expand Down Expand Up @@ -276,7 +281,15 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
object->map.size = 0;

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);
return -ENOMEM;
}
Expand All @@ -293,8 +306,7 @@ nvif_object_ctor(struct nvif_object *parent, const char *name, u32 handle,
args->new.oclass = oclass;

memcpy(args->new.data, data, size);
ret = nvif_object_ioctl(parent, args, sizeof(*args) + size,
&object->priv);
ret = nvif_object_ioctl(parent, args, args_size, &object->priv);
memcpy(data, args->new.data, size);
kfree(args);
if (ret == 0)
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/panel/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,8 @@ config DRM_PANEL_LG_SW43408
depends on OF
depends on DRM_MIPI_DSI
depends on BACKLIGHT_CLASS_DEVICE
select DRM_DISPLAY_DP_HELPER
select DRM_DISPLAY_HELPER
help
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
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panel/panel-lg-sw43408.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ static int sw43408_backlight_update_status(struct backlight_device *bl)
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,
};

Expand Down
16 changes: 8 additions & 8 deletions drivers/gpu/drm/panel/panel-sitronix-st7789v.c
Original file line number Diff line number Diff line change
Expand Up @@ -282,15 +282,15 @@ static const struct drm_display_mode et028013dma_mode = {
static const struct drm_display_mode jt240mhqs_hwt_ek_e3_mode = {
.clock = 6000,
.hdisplay = 240,
.hsync_start = 240 + 28,
.hsync_end = 240 + 28 + 10,
.htotal = 240 + 28 + 10 + 10,
.hsync_start = 240 + 38,
.hsync_end = 240 + 38 + 10,
.htotal = 240 + 38 + 10 + 10,
.vdisplay = 280,
.vsync_start = 280 + 8,
.vsync_end = 280 + 8 + 4,
.vtotal = 280 + 8 + 4 + 4,
.width_mm = 43,
.height_mm = 37,
.vsync_start = 280 + 48,
.vsync_end = 280 + 48 + 4,
.vtotal = 280 + 48 + 4 + 4,
.width_mm = 37,
.height_mm = 43,
.flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC,
};

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/panfrost/panfrost_gem.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ static int panfrost_gem_pin(struct drm_gem_object *obj)
if (bo->is_heap)
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)
Expand Down

0 comments on commit a2ce3f7

Please sign in to comment.