Skip to content

Commit

Permalink
Merge tag 'drm-misc-fixes-2023-09-21' of git://anongit.freedesktop.or…
Browse files Browse the repository at this point in the history
…g/drm/drm-misc into drm-fixes

Short summary of fixes pull:

 * DRM MM-test fixes
 * Fbdev Kconfig fixes

 * ivpu:
   * IRQ-handling fixes

 * meson:
   * Fix memory leak in HDMI EDID code

 * nouveau:
   * Correct type casting
   * Fix memory leak in scheduler
   * u_memcpya() fixes

 * virtio:
   * Fence cleanups

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/20230921153712.GA14059@linux-uq9g
  • Loading branch information
Dave Airlie committed Sep 22, 2023
2 parents ce9ecca + f75f71b commit f675553
Show file tree
Hide file tree
Showing 12 changed files with 31 additions and 25 deletions.
9 changes: 8 additions & 1 deletion drivers/accel/ivpu/ivpu_hw_40xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,8 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
if (status == 0)
return IRQ_NONE;

REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);
/* Disable global interrupt before handling local buttress interrupts */
REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x1);

if (REG_TEST_FLD(VPU_40XX_BUTTRESS_INTERRUPT_STAT, FREQ_CHANGE, status))
ivpu_dbg(vdev, IRQ, "FREQ_CHANGE");
Expand Down Expand Up @@ -1092,6 +1093,12 @@ static irqreturn_t ivpu_hw_40xx_irqb_handler(struct ivpu_device *vdev, int irq)
schedule_recovery = true;
}

/* This must be done after interrupts are cleared at the source. */
REGB_WR32(VPU_40XX_BUTTRESS_INTERRUPT_STAT, status);

/* Re-enable global interrupt */
REGB_WR32(VPU_40XX_BUTTRESS_GLOBAL_INT_MASK, 0x0);

if (schedule_recovery)
ivpu_pm_schedule_recovery(vdev);

Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ config DRM_FBDEV_EMULATION
bool "Enable legacy fbdev support for your modesetting driver"
depends on DRM
select FRAMEBUFFER_CONSOLE_DETECT_PRIMARY if FRAMEBUFFER_CONSOLE
default y
default FB
help
Choose this option if you have a need for the legacy fbdev
support. Note that this support also provides the linux console
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/meson/meson_encoder_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,8 @@ static void meson_encoder_hdmi_hpd_notify(struct drm_bridge *bridge,
return;

cec_notifier_set_phys_addr_from_edid(encoder_hdmi->cec_notifier, edid);

kfree(edid);
} else
cec_notifier_phys_addr_invalidate(encoder_hdmi->cec_notifier);
}
Expand Down
19 changes: 5 additions & 14 deletions drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,21 +189,12 @@ u_free(void *addr)
static inline void *
u_memcpya(uint64_t user, unsigned int nmemb, unsigned int size)
{
void *mem;
void __user *userptr = (void __force __user *)(uintptr_t)user;
void __user *userptr = u64_to_user_ptr(user);
size_t bytes;

size *= nmemb;

mem = kvmalloc(size, GFP_KERNEL);
if (!mem)
return ERR_PTR(-ENOMEM);

if (copy_from_user(mem, userptr, size)) {
u_free(mem);
return ERR_PTR(-EFAULT);
}

return mem;
if (unlikely(check_mul_overflow(nmemb, size, &bytes)))
return ERR_PTR(-EOVERFLOW);
return vmemdup_user(userptr, bytes);
}

#include <nvif/object.h>
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_exec.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ nouveau_exec_job_timeout(struct nouveau_job *job)

nouveau_sched_entity_fini(job->entity);

return DRM_GPU_SCHED_STAT_ENODEV;
return DRM_GPU_SCHED_STAT_NOMINAL;
}

static struct nouveau_job_ops nouveau_exec_job_ops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/nouveau/nouveau_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_cha
int
nouveau_fence_emit(struct nouveau_fence *fence)
{
struct nouveau_channel *chan = fence->channel;
struct nouveau_channel *chan = unrcu_pointer(fence->channel);
struct nouveau_fence_chan *fctx = chan->fence;
struct nouveau_fence_priv *priv = (void*)chan->drm->fence;
int ret;
Expand Down
12 changes: 9 additions & 3 deletions drivers/gpu/drm/nouveau/nouveau_sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -375,14 +375,20 @@ nouveau_sched_run_job(struct drm_sched_job *sched_job)
static enum drm_gpu_sched_stat
nouveau_sched_timedout_job(struct drm_sched_job *sched_job)
{
struct drm_gpu_scheduler *sched = sched_job->sched;
struct nouveau_job *job = to_nouveau_job(sched_job);
enum drm_gpu_sched_stat stat = DRM_GPU_SCHED_STAT_NOMINAL;

NV_PRINTK(warn, job->cli, "Job timed out.\n");
drm_sched_stop(sched, sched_job);

if (job->ops->timeout)
return job->ops->timeout(job);
stat = job->ops->timeout(job);
else
NV_PRINTK(warn, job->cli, "Generic job timeout.\n");

drm_sched_start(sched, true);

return DRM_GPU_SCHED_STAT_ENODEV;
return stat;
}

static void
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/tests/drm_mm_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,7 @@ static void drm_test_mm_insert_range(struct kunit *test)
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size, 0, max - 1));
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size, 0, max / 2));
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size,
max / 2, max / 2));
max / 2, max));
KUNIT_ASSERT_FALSE(test, __drm_test_mm_insert_range(test, count, size,
max / 4 + 1, 3 * max / 4 - 1));

Expand Down
1 change: 0 additions & 1 deletion drivers/gpu/drm/virtio/virtgpu_submit.c
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,6 @@ static void virtio_gpu_complete_submit(struct virtio_gpu_submit *submit)
submit->buf = NULL;
submit->buflist = NULL;
submit->sync_file = NULL;
submit->out_fence = NULL;
submit->out_fence_fd = -1;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/video/console/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ config DUMMY_CONSOLE_ROWS
config FRAMEBUFFER_CONSOLE
bool "Framebuffer Console support"
depends on FB_CORE && !UML
default DRM_FBDEV_EMULATION
select VT_HW_CONSOLE_BINDING
select CRC32
select FONT_SUPPORT
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ config FB_COBALT

config FB_SH7760
bool "SH7760/SH7763/SH7720/SH7721 LCDC support"
depends on FB && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \
depends on FB=y && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \
|| CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721)
select FB_IOMEM_HELPERS
help
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/fbdev/core/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ config FIRMWARE_EDID
config FB_DEVICE
bool "Provide legacy /dev/fb* device"
depends on FB_CORE
default y
default FB
help
Say Y here if you want the legacy /dev/fb* device file and
interfaces within sysfs anc procfs. It is only required if you
Expand Down

0 comments on commit f675553

Please sign in to comment.