Skip to content

Commit 26c7a18

Browse files
committed
Merge tag 'drm-misc-fixes-2025-11-27' of https://gitlab.freedesktop.org/drm/misc/kernel into drm-fixes
Short summary of fixes pull: bridge: - sil902x: Fix HDMI detection imagination: - Update documentation sti: - Fix leaks in probe vga_switcheroo: - Avoid race condition during fbcon initialization Signed-off-by: Dave Airlie <airlied@redhat.com> From: Thomas Zimmermann <tzimmermann@suse.de> Link: https://patch.msgid.link/20251127081007.GA13578@2a02-2454-fd5e-fd00-689d-32c0-780c-bb87.dyn6.pyur.net
2 parents 4fc3ad6 + eb76d0f commit 26c7a18

5 files changed

Lines changed: 31 additions & 27 deletions

File tree

drivers/gpu/drm/bridge/sii902x.c

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,6 @@ struct sii902x {
179179
struct drm_connector connector;
180180
struct gpio_desc *reset_gpio;
181181
struct i2c_mux_core *i2cmux;
182-
bool sink_is_hdmi;
183182
u32 bus_width;
184183

185184
/*
@@ -315,8 +314,6 @@ static int sii902x_get_modes(struct drm_connector *connector)
315314
drm_edid_free(drm_edid);
316315
}
317316

318-
sii902x->sink_is_hdmi = connector->display_info.is_hdmi;
319-
320317
return num;
321318
}
322319

@@ -342,9 +339,17 @@ static void sii902x_bridge_atomic_enable(struct drm_bridge *bridge,
342339
struct drm_atomic_state *state)
343340
{
344341
struct sii902x *sii902x = bridge_to_sii902x(bridge);
342+
struct drm_connector *connector;
343+
u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;
344+
345+
connector = drm_atomic_get_new_connector_for_encoder(state, bridge->encoder);
346+
if (connector && connector->display_info.is_hdmi)
347+
output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
345348

346349
mutex_lock(&sii902x->mutex);
347350

351+
regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
352+
SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
348353
regmap_update_bits(sii902x->regmap, SII902X_PWR_STATE_CTRL,
349354
SII902X_AVI_POWER_STATE_MSK,
350355
SII902X_AVI_POWER_STATE_D(0));
@@ -359,16 +364,12 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
359364
const struct drm_display_mode *adj)
360365
{
361366
struct sii902x *sii902x = bridge_to_sii902x(bridge);
362-
u8 output_mode = SII902X_SYS_CTRL_OUTPUT_DVI;
363367
struct regmap *regmap = sii902x->regmap;
364368
u8 buf[HDMI_INFOFRAME_SIZE(AVI)];
365369
struct hdmi_avi_infoframe frame;
366370
u16 pixel_clock_10kHz = adj->clock / 10;
367371
int ret;
368372

369-
if (sii902x->sink_is_hdmi)
370-
output_mode = SII902X_SYS_CTRL_OUTPUT_HDMI;
371-
372373
buf[0] = pixel_clock_10kHz & 0xff;
373374
buf[1] = pixel_clock_10kHz >> 8;
374375
buf[2] = drm_mode_vrefresh(adj);
@@ -384,11 +385,6 @@ static void sii902x_bridge_mode_set(struct drm_bridge *bridge,
384385

385386
mutex_lock(&sii902x->mutex);
386387

387-
ret = regmap_update_bits(sii902x->regmap, SII902X_SYS_CTRL_DATA,
388-
SII902X_SYS_CTRL_OUTPUT_MODE, output_mode);
389-
if (ret)
390-
goto out;
391-
392388
ret = regmap_bulk_write(regmap, SII902X_TPI_VIDEO_DATA, buf, 10);
393389
if (ret)
394390
goto out;

drivers/gpu/drm/drm_fb_helper.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@
3131

3232
#include <linux/console.h>
3333
#include <linux/export.h>
34-
#include <linux/pci.h>
3534
#include <linux/sysrq.h>
36-
#include <linux/vga_switcheroo.h>
3735

3836
#include <drm/drm_atomic.h>
3937
#include <drm/drm_drv.h>
@@ -566,11 +564,6 @@ EXPORT_SYMBOL(drm_fb_helper_release_info);
566564
*/
567565
void drm_fb_helper_unregister_info(struct drm_fb_helper *fb_helper)
568566
{
569-
struct fb_info *info = fb_helper->info;
570-
struct device *dev = info->device;
571-
572-
if (dev_is_pci(dev))
573-
vga_switcheroo_client_fb_set(to_pci_dev(dev), NULL);
574567
unregister_framebuffer(fb_helper->info);
575568
}
576569
EXPORT_SYMBOL(drm_fb_helper_unregister_info);
@@ -1632,7 +1625,6 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
16321625
struct drm_client_dev *client = &fb_helper->client;
16331626
struct drm_device *dev = fb_helper->dev;
16341627
struct drm_fb_helper_surface_size sizes;
1635-
struct fb_info *info;
16361628
int ret;
16371629

16381630
if (drm_WARN_ON(dev, !dev->driver->fbdev_probe))
@@ -1653,12 +1645,6 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper)
16531645

16541646
strcpy(fb_helper->fb->comm, "[fbcon]");
16551647

1656-
info = fb_helper->info;
1657-
1658-
/* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */
1659-
if (dev_is_pci(info->device))
1660-
vga_switcheroo_client_fb_set(to_pci_dev(info->device), info);
1661-
16621648
return 0;
16631649
}
16641650

drivers/gpu/drm/imagination/pvr_device.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ struct pvr_device {
146146
*/
147147
struct clk *mem_clk;
148148

149+
/**
150+
* @power: Optional power domain devices.
151+
*
152+
* On platforms with more than one power domain for the GPU, they are
153+
* stored here in @domain_devs, along with links between them in
154+
* @domain_links. The size of @domain_devs is given by @domain_count,
155+
* while the size of @domain_links is (2 * @domain_count) - 1.
156+
*/
149157
struct pvr_device_power {
150158
struct device **domain_devs;
151159
struct device_link **domain_links;

drivers/gpu/drm/sti/sti_vtg.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,17 @@ struct sti_vtg {
143143
struct sti_vtg *of_vtg_find(struct device_node *np)
144144
{
145145
struct platform_device *pdev;
146+
struct sti_vtg *vtg;
146147

147148
pdev = of_find_device_by_node(np);
148149
if (!pdev)
149150
return NULL;
150151

151-
return (struct sti_vtg *)platform_get_drvdata(pdev);
152+
vtg = platform_get_drvdata(pdev);
153+
154+
put_device(&pdev->dev);
155+
156+
return vtg;
152157
}
153158

154159
static void vtg_reset(struct sti_vtg *vtg)

drivers/video/fbdev/core/fbcon.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@
6666
#include <linux/string.h>
6767
#include <linux/kd.h>
6868
#include <linux/panic.h>
69+
#include <linux/pci.h>
6970
#include <linux/printk.h>
7071
#include <linux/slab.h>
7172
#include <linux/fb.h>
@@ -78,6 +79,7 @@
7879
#include <linux/interrupt.h>
7980
#include <linux/crc32.h> /* For counting font checksums */
8081
#include <linux/uaccess.h>
82+
#include <linux/vga_switcheroo.h>
8183
#include <asm/irq.h>
8284

8385
#include "fbcon.h"
@@ -2899,6 +2901,9 @@ void fbcon_fb_unregistered(struct fb_info *info)
28992901

29002902
console_lock();
29012903

2904+
if (info->device && dev_is_pci(info->device))
2905+
vga_switcheroo_client_fb_set(to_pci_dev(info->device), NULL);
2906+
29022907
fbcon_registered_fb[info->node] = NULL;
29032908
fbcon_num_registered_fb--;
29042909

@@ -3032,6 +3037,10 @@ static int do_fb_registered(struct fb_info *info)
30323037
}
30333038
}
30343039

3040+
/* Set the fb info for vga_switcheroo clients. Does nothing otherwise. */
3041+
if (info->device && dev_is_pci(info->device))
3042+
vga_switcheroo_client_fb_set(to_pci_dev(info->device), info);
3043+
30353044
return ret;
30363045
}
30373046

0 commit comments

Comments
 (0)