Merge tag 'drm-misc-fixes-2026-11-13' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes

Short summary of fixes pull:

bridge:
- ssd2825: Fix panel enable sequence
- sii902x: validate I2S data lane values

display:
- hdmi: Fixes to SCDC

gud:
- Avoid divide error in gud_stats_debugfs

meson:
- load ENCL gamma table while ENCL is disabled

nouveau:
- disp: Set atomic functions in struct drm_mode_config_funcs
- gsp: Handle only IRQs routed to host

panfrost:
- Fixes to perfcnt

sched:
- Ensure stopped entity cannot be re-added to the run-queue

vc4:
- Fix firmware reference leak
- Hold runtime PM reference while allocating the binner BO
- Rebuild V3D interrupt mask on every power transition
- Re-enable the V3D interrupt after a GPU reset

Signed-off-by: Dave Airlie <[email protected]>

From: Thomas Zimmermann <[email protected]>
Link: https://patch.msgid.link/[email protected]
This commit is contained in:
Dave Airlie
2026-11-14 09:49:09 +10:00
18 changed files with 153 additions and 64 deletions
+1
View File
@@ -8362,6 +8362,7 @@ F: drivers/gpu/drm/tiny/hx8357d.c
DRM DRIVER FOR HYPERV SYNTHETIC VIDEO DEVICE
M: Dexuan Cui <[email protected]>
M: Hamza Mahfooz <[email protected]>
M: Saurabh Sengar <[email protected]>
L: [email protected]
L: [email protected]
+7 -1
View File
@@ -890,9 +890,15 @@ static int sii902x_audio_codec_init(struct sii902x *sii902x,
}
codec_data.max_i2s_channels = 2 * num_lanes;
for (i = 0; i < num_lanes; i++)
for (i = 0; i < num_lanes; i++) {
if (lanes[i] >= ARRAY_SIZE(i2s_lane_id))
return dev_err_probe(dev, -EINVAL,
"invalid sil,i2s-data-lanes value %u\n",
lanes[i]);
sii902x->audio.i2s_fifo_sequence[i] |= audio_fifo_id[i] |
i2s_lane_id[lanes[i]] | SII902X_TPI_I2S_FIFO_ENABLE;
}
sii902x->audio.mclk = devm_clk_get_optional(dev, "mclk");
if (IS_ERR(sii902x->audio.mclk)) {
+9
View File
@@ -475,6 +475,7 @@ static void ssd2825_bridge_atomic_pre_enable(struct drm_bridge *bridge,
struct drm_atomic_commit *state)
{
struct ssd2825_priv *priv = bridge_to_ssd2825(bridge);
struct drm_bridge *next_bridge = priv->output.bridge;
struct mipi_dsi_device *dsi_dev = priv->output.dev;
const struct drm_crtc_state *crtc_state;
const struct drm_display_mode *mode;
@@ -569,6 +570,14 @@ static void ssd2825_bridge_atomic_pre_enable(struct drm_bridge *bridge,
/* Initial DSI configuration register set */
ssd2825_write_reg(priv, SSD2825_CONFIGURATION_REG, config);
ssd2825_write_reg(priv, SSD2825_VC_CTRL_REG, 0);
/*
* The SSD2825 requires that the next bridge be enabled first;
* otherwise, the SSD2825 cannot complete its configuration and
* there will be no output.
*/
if (next_bridge->funcs && next_bridge->funcs->atomic_enable)
next_bridge->funcs->atomic_enable(next_bridge, state);
}
static void ssd2825_bridge_atomic_enable(struct drm_bridge *bridge,
+50 -15
View File
@@ -470,6 +470,28 @@ static bool drm_scdc_sink_supports_scrambling(struct drm_connector *connector)
info->hdmi.scdc.scrambling.supported;
}
static void drm_connector_hdmi_reset_sink_scrambling(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
u8 config;
int ret;
if (!connector->ddc || !drm_scdc_sink_supports_scrambling(connector))
return;
ret = drm_scdc_readb(connector->ddc, SCDC_TMDS_CONFIG, &config);
if (ret) {
drm_dbg_kms(dev, "Failed to read TMDS config: %d\n", ret);
return;
}
if (config & SCDC_SCRAMBLING_ENABLE)
drm_scdc_set_scrambling(connector, false);
if (config & SCDC_TMDS_BIT_CLOCK_RATIO_BY_40)
drm_scdc_set_high_tmds_clock_ratio(connector, false);
}
static int drm_connector_hdmi_try_scrambling_setup(struct drm_connector *connector)
{
bool done;
@@ -522,6 +544,11 @@ static void drm_connector_hdmi_scdc_work(struct work_struct *work)
* the sink side and retry the operation, as some displays refuse to set the
* scrambling bit right away.
*
* When @conn_state doesn't require scrambling, the sink-side SCDC status is
* reset instead, so that a sink left scrambling by a state the driver did not
* control, e.g. set up by the firmware before boot, doesn't end up out of sync
* with the source.
*
* The work item is cancelled by drm_connector_hdmi_disable_scrambling(), hence
* source drivers must ensure the display pipeline is shut down on unbind, e.g.
* via drm_atomic_helper_shutdown(). Otherwise the work may outlive the driver's
@@ -541,8 +568,14 @@ int drm_connector_hdmi_enable_scrambling(struct drm_connector *connector,
if (!conn_state)
return -EINVAL;
if (!conn_state->hdmi.scrambler_needed)
if (!conn_state->hdmi.scrambler_needed) {
/*
* Resync the sink here, where it is known to be connected
* and its capabilities have been parsed.
*/
drm_connector_hdmi_reset_sink_scrambling(connector);
return 0;
}
if (!drm_connector_hdmi_scrambler_supported(connector)) {
drm_dbg_kms(dev, "Source doesn't support scrambling.\n");
@@ -581,8 +614,7 @@ int drm_connector_hdmi_enable_scrambling(struct drm_connector *connector,
WRITE_ONCE(hdmi->scrambler_enabled, false);
cancel_delayed_work_sync(&hdmi->scdc_work);
drm_scdc_set_scrambling(connector, false);
drm_scdc_set_high_tmds_clock_ratio(connector, false);
drm_connector_hdmi_reset_sink_scrambling(connector);
}
return ret;
@@ -619,12 +651,7 @@ int drm_connector_hdmi_disable_scrambling(struct drm_connector *connector)
if (hdmi->scdc_work_initialized)
cancel_delayed_work_sync(&hdmi->scdc_work);
if (connector->ddc &&
connector->status == connector_status_connected &&
drm_scdc_sink_supports_scrambling(connector)) {
drm_scdc_set_scrambling(connector, false);
drm_scdc_set_high_tmds_clock_ratio(connector, false);
}
drm_connector_hdmi_reset_sink_scrambling(connector);
return hdmi->funcs->scrambler_disable(connector);
}
@@ -653,9 +680,8 @@ EXPORT_SYMBOL(drm_connector_hdmi_disable_scrambling);
int drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged,
struct drm_modeset_acquire_ctx *ctx)
{
struct drm_connector_hdmi *hdmi = &connector->hdmi;
struct drm_device *dev = connector->dev;
struct drm_connector_state *conn_state;
struct drm_device *dev;
struct drm_crtc *crtc;
u8 config;
int ret;
@@ -663,6 +689,8 @@ int drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged,
if (!connector || !plugged || !ctx)
return 0;
dev = connector->dev;
/*
* This is normally part of .detect_ctx() call path, which already holds
* connection_mutex through @ctx. However, re-acquiring it with the
@@ -674,14 +702,21 @@ int drm_connector_hdmi_sync_scdc(struct drm_connector *connector, bool plugged,
/* TODO: Also handle HDMI 2.1 FRL link training */
if (!drm_connector_hdmi_scrambler_supported(connector) ||
!READ_ONCE(hdmi->scrambler_enabled))
return 0;
conn_state = connector->state;
if (!conn_state)
return 0;
/*
* Rely on the committed connector state rather than on the current
* scrambler status: a source driver may force scrambler_enabled at
* init to get a disable at boot (e.g. vc4), and that value would
* remain stale until the first disable actually happens, leading to
* a spurious CRTC reset whenever the active mode needs no scrambling.
*/
if (!drm_connector_hdmi_scrambler_supported(connector) ||
!conn_state->hdmi.scrambler_needed)
return 0;
crtc = conn_state->crtc;
if (!crtc)
return 0;
+10 -3
View File
@@ -329,10 +329,17 @@ static int gud_stats_debugfs(struct seq_file *m, void *data)
seq_puts(m, "\n");
if (gdrm->compression) {
u64 actual_length = gdrm->stats_actual_length;
u64 remainder;
u64 ratio = div64_u64_rem(gdrm->stats_length, gdrm->stats_actual_length,
&remainder);
u64 ratio_frac = div64_u64(remainder * 10, gdrm->stats_actual_length);
u64 ratio, ratio_frac;
if (!actual_length) {
seq_puts(m, "Compression ratio: n/a\n");
return 0;
}
ratio = div64_u64_rem(gdrm->stats_length, actual_length, &remainder);
ratio_frac = div64_u64(remainder * 10, actual_length);
seq_printf(m, "Compression ratio: %llu.%llu\n", ratio, ratio_frac);
}
+1 -1
View File
@@ -65,9 +65,9 @@ static void meson_encoder_dsi_atomic_enable(struct drm_bridge *bridge,
/* ENCL clock setup is handled by CCF */
meson_venc_mipi_dsi_mode_set(priv, &crtc_state->adjusted_mode);
meson_encl_load_gamma(priv);
writel_relaxed(0, priv->io_base + _REG(ENCL_VIDEO_EN));
meson_encl_load_gamma(priv);
writel_bits_relaxed(ENCL_VIDEO_MODE_ADV_VFIFO_EN, ENCL_VIDEO_MODE_ADV_VFIFO_EN,
priv->io_base + _REG(ENCL_VIDEO_MODE_ADV));
@@ -63,6 +63,7 @@ struct nvkm_falcon_func {
int (*select)(struct nvkm_falcon *);
u32 addr2;
u32 riscv_irqmask;
u32 riscv_irqdest;
bool reset_pmc;
int (*reset_eng)(struct nvkm_falcon *);
int (*reset_prep)(struct nvkm_falcon *);
+10 -1
View File
@@ -354,6 +354,11 @@ static const struct drm_mode_config_funcs nouveau_mode_config_funcs = {
.fb_create = nouveau_user_framebuffer_create,
};
static const struct drm_mode_config_funcs nouveau_mode_config_funcs_atomic = {
.fb_create = nouveau_user_framebuffer_create,
.atomic_commit = drm_atomic_helper_commit,
.atomic_check = drm_atomic_helper_check,
};
struct nouveau_drm_prop_enum_list {
u8 gen_mask;
@@ -654,7 +659,11 @@ nouveau_display_create(struct drm_device *dev)
drm_mode_create_scaling_mode_property(dev);
drm_mode_create_dvi_i_properties(dev);
dev->mode_config.funcs = &nouveau_mode_config_funcs;
/* this only gets set if the driver has the ATOMIC flag */
if (drm_drv_uses_atomic_modeset(dev))
dev->mode_config.funcs = &nouveau_mode_config_funcs_atomic;
else
dev->mode_config.funcs = &nouveau_mode_config_funcs;
dev->mode_config.min_width = 0;
dev->mode_config.min_height = 0;
@@ -27,6 +27,7 @@ ga100_gsp_flcn = {
.enable = gm200_flcn_enable,
.addr2 = 0x1000,
.riscv_irqmask = 0x2b4,
.riscv_irqdest = 0x2b8,
.reset_eng = gp102_flcn_reset_eng,
.reset_wait_mem_scrubbing = gm200_flcn_reset_wait_mem_scrubbing,
.bind_inst = gm200_flcn_bind_inst,
@@ -140,6 +140,7 @@ ga102_gsp_flcn = {
.select = ga102_flcn_select,
.addr2 = 0x1000,
.riscv_irqmask = 0x528,
.riscv_irqdest = 0x52c,
.reset_eng = gp102_flcn_reset_eng,
.reset_prep = ga102_flcn_reset_prep,
.reset_wait_mem_scrubbing = ga102_flcn_reset_wait_mem_scrubbing,
@@ -64,7 +64,9 @@ r535_gsp_intr(struct nvkm_inth *inth)
u32 intr = nvkm_falcon_rd32(&gsp->falcon, 0x0008);
u32 inte = nvkm_falcon_rd32(&gsp->falcon, gsp->falcon.func->addr2 +
gsp->falcon.func->riscv_irqmask);
u32 stat = intr & inte;
u32 dest = nvkm_falcon_rd32(&gsp->falcon, gsp->falcon.func->addr2 +
gsp->falcon.func->riscv_irqdest);
u32 stat = intr & inte & dest;
if (!stat) {
nvkm_debug(subdev, "inte %08x %08x\n", intr, inte);
@@ -420,6 +420,7 @@ tu102_gsp_flcn = {
.enable = gm200_flcn_enable,
.addr2 = 0x1000,
.riscv_irqmask = 0x2b4,
.riscv_irqdest = 0x2b8,
.reset_eng = gp102_flcn_reset_eng,
.reset_wait_mem_scrubbing = gm200_flcn_reset_wait_mem_scrubbing,
.bind_inst = gm200_flcn_bind_inst,
+3 -4
View File
@@ -94,11 +94,10 @@ int panfrost_gpu_soft_reset(struct panfrost_device *pfdev)
GPU_IRQ_CLEAN_CACHES_COMPLETED);
/*
* All in-flight jobs should have released their cycle
* counter references upon reset, but let us make sure
* Even though all in-flight jobs should have released their cycle counter
* references upon reset, perfcnt's might still hang about.
*/
if (drm_WARN_ON(&pfdev->base, atomic_read(&pfdev->cycle_counter.use_count) != 0))
atomic_set(&pfdev->cycle_counter.use_count, 0);
atomic_set(&pfdev->cycle_counter.use_count, 0);
return 0;
}
+10 -8
View File
@@ -17,6 +17,7 @@
#include "panfrost_device.h"
#include "panfrost_features.h"
#include "panfrost_gem.h"
#include "panfrost_gpu.h"
#include "panfrost_issues.h"
#include "panfrost_job.h"
#include "panfrost_mmu.h"
@@ -52,6 +53,7 @@ static void panfrost_perfcnt_hw_disable(struct panfrost_device *pfdev)
gpu_write(pfdev, GPU_PRFCNT_TILER_EN, 0);
if (perfcnt->owns_as_ref) {
panfrost_cycle_counter_put(pfdev);
panfrost_mmu_as_put(pfdev, perfcnt->mapping->mmu);
perfcnt->owns_as_ref = false;
}
@@ -84,6 +86,7 @@ static int panfrost_perfcnt_hw_enable(struct panfrost_device *pfdev)
return ret;
perfcnt->owns_as_ref = true;
panfrost_cycle_counter_get(pfdev);
as = ret;
cfg = GPU_PERFCNT_CFG_AS(as) |
@@ -145,18 +148,17 @@ static int panfrost_perfcnt_dump_locked(struct panfrost_device *pfdev, u32 *stat
*/
ret = wait_for_completion_interruptible_timeout(&pfdev->perfcnt->dump_comp,
msecs_to_jiffies(1000));
if (!ret)
ret = -ETIMEDOUT;
/* We need to restore perfcnt state so the next successful dump can relay it to UM */
if (ret < 0) {
perfcnt->state |= *state;
*state = 0;
return ret;
}
scoped_guard(rwsem_read, &pfdev->reset.lock) {
/* Restore perfcnt state so the next successful dump can relay it to UM */
if (ret < 0) {
perfcnt->state |= *state;
*state = 0;
return ret;
}
*state |= perfcnt->state;
/* UM must re-enable their session before requesting new dumps. */
+7
View File
@@ -345,6 +345,13 @@ void drm_sched_rq_pop_entity(struct drm_sched_entity *entity)
lockdep_assert_held(&entity->lock);
/*
* If entity is getting torn down via drm_sched_entity_kill() we need
* to ensure it does not get re-added to the tree behind it's back.
*/
if (entity->stopped)
return;
spin_lock(&rq->lock);
/*
+9 -9
View File
@@ -1677,15 +1677,6 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
struct device_node *node;
unsigned int max_rate;
node = rpi_firmware_find_node();
if (!node)
return -EINVAL;
firmware = rpi_firmware_get(node);
of_node_put(node);
if (!firmware)
return -EPROBE_DEFER;
hvs->core_clk = devm_clk_get(&pdev->dev,
(vc4->gen >= VC4_GEN_6_C) ? "core" : NULL);
if (IS_ERR(hvs->core_clk)) {
@@ -1700,6 +1691,15 @@ static int vc4_hvs_bind(struct device *dev, struct device *master, void *data)
return PTR_ERR(hvs->disp_clk);
}
node = rpi_firmware_find_node();
if (!node)
return -EINVAL;
firmware = rpi_firmware_get(node);
of_node_put(node);
if (!firmware)
return -EPROBE_DEFER;
max_rate = rpi_firmware_clk_get_max_rate(firmware,
RPI_FIRMWARE_CORE_CLK_ID);
rpi_firmware_put(firmware);
+23 -19
View File
@@ -53,10 +53,6 @@
#include "vc4_regs.h"
#include "vc4_trace.h"
#define V3D_DRIVER_IRQS (V3D_INT_OUTOMEM | \
V3D_INT_FLDONE | \
V3D_INT_FRDONE)
static void
vc4_overflow_mem_work(struct work_struct *work)
{
@@ -249,6 +245,7 @@ void
vc4_irq_enable(struct drm_device *dev)
{
struct vc4_dev *vc4 = to_vc4_dev(dev);
u32 mask = V3D_INT_FLDONE | V3D_INT_FRDONE;
if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4))
return;
@@ -256,10 +253,20 @@ vc4_irq_enable(struct drm_device *dev)
if (!vc4->v3d)
return;
/* Enable the render done interrupts. The out-of-memory interrupt is
* enabled as soon as we have a binner BO allocated.
/* Arming the OOM interrupt before there is a binner BO would raise an
* interrupt nothing can clear.
*/
V3D_WRITE(V3D_INTENA, V3D_INT_FLDONE | V3D_INT_FRDONE);
if (vc4->bin_bo)
mask |= V3D_INT_OUTOMEM;
/* Clear any pending interrupts someone might have left around for us. */
V3D_WRITE(V3D_INTCTL, mask);
/* Enable our set of interrupts, masking out any others. */
V3D_WRITE(V3D_INTDIS, ~mask);
V3D_WRITE(V3D_INTENA, mask);
enable_irq(vc4->irq);
}
void
@@ -274,14 +281,14 @@ vc4_irq_disable(struct drm_device *dev)
return;
/* Disable sending interrupts for our driver's IRQs. */
V3D_WRITE(V3D_INTDIS, V3D_DRIVER_IRQS);
/* Clear any pending interrupts we might have left. */
V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
V3D_WRITE(V3D_INTDIS, ~0);
/* Finish any interrupt handler still in flight. */
disable_irq(vc4->irq);
/* Clear any pending interrupts we might have left. */
V3D_WRITE(V3D_INTCTL, ~0);
cancel_work_sync(&vc4->overflow_mem_work);
}
@@ -324,15 +331,12 @@ void vc4_irq_reset(struct drm_device *dev)
if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4))
return;
/* Acknowledge any stale IRQs. */
V3D_WRITE(V3D_INTCTL, V3D_DRIVER_IRQS);
/*
* Turn all our interrupts on. Binner out of memory is the only
* one we expect to trigger at this point, since the reset cleared
* the overflow memory address and none has been supplied yet.
/* bin_bo_alloc() may arm OUTOMEM between the bin_bo check and the
* INTDIS write in vc4_irq_enable(), which would then mask it again.
*/
V3D_WRITE(V3D_INTENA, V3D_DRIVER_IRQS);
scoped_guard(mutex, &vc4->bin_bo_lock) {
vc4_irq_enable(dev);
}
spin_lock_irqsave(&vc4->job_lock, irqflags);
vc4_cancel_bin_job(dev);
+6 -2
View File
@@ -302,11 +302,15 @@ static int bin_bo_alloc(struct vc4_dev *vc4)
int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used)
{
int ret = 0;
int ret;
if (WARN_ON_ONCE(vc4->gen > VC4_GEN_4))
return -ENODEV;
ret = vc4_v3d_pm_get(vc4);
if (ret)
return ret;
mutex_lock(&vc4->bin_bo_lock);
if (used && *used)
@@ -322,6 +326,7 @@ int vc4_v3d_bin_bo_get(struct vc4_dev *vc4, bool *used)
complete:
mutex_unlock(&vc4->bin_bo_lock);
vc4_v3d_pm_put(vc4);
return ret;
}
@@ -373,7 +378,6 @@ static int vc4_v3d_runtime_resume(struct device *dev)
vc4_v3d_init_hw(&vc4->base);
vc4_irq_enable(&vc4->base);
enable_irq(vc4->irq);
return 0;
}