Skip to content

Commit c8a04cb

Browse files
committed
Merge tag 'drm-misc-next-2021-11-29' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.17: UAPI Changes: Cross-subsystem Changes: * Move 'nomodeset' kernel boot option into DRM subsystem Core Changes: * Replace several DRM_*() logging macros with drm_*() equivalents * panel: Add quirk for Lenovo Yoga Book X91F/L * ttm: Documentation fixes Driver Changes: * Cleanup nomodeset handling in drivers * Fixes * bridge/anx7625: Fix reading EDID; Fix error code * bridge/megachips: Probe both bridges before registering * vboxvideo: Fix ERR_PTR usage Signed-off-by: Daniel Vetter <[email protected]> From: Thomas Zimmermann <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents c305ae9 + 69d8461 commit c8a04cb

29 files changed

+344
-285
lines changed

Documentation/admin-guide/kernel-parameters.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3545,6 +3545,13 @@
35453545
shutdown the other cpus. Instead use the REBOOT_VECTOR
35463546
irq.
35473547

3548+
nomodeset Disable kernel modesetting. DRM drivers will not perform
3549+
display-mode changes or accelerated rendering. Only the
3550+
system framebuffer will be available for use if this was
3551+
set-up by the firmware or boot loader.
3552+
3553+
Useful as fallback, or for testing and debugging.
3554+
35483555
nomodule Disable module load
35493556

35503557
nopat [X86] Disable PAT (page attribute table extension of

drivers/gpu/drm/Kconfig

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
menuconfig DRM
99
tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
1010
depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA
11+
select DRM_NOMODESET
1112
select DRM_PANEL_ORIENTATION_QUIRKS
1213
select HDMI
1314
select FB_CMDLINE
@@ -492,6 +493,11 @@ config DRM_EXPORT_FOR_TESTS
492493
config DRM_PANEL_ORIENTATION_QUIRKS
493494
tristate
494495

496+
# Separate option because nomodeset parameter is global and expected built-in
497+
config DRM_NOMODESET
498+
bool
499+
default n
500+
495501
config DRM_LIB_RANDOM
496502
bool
497503
default n

drivers/gpu/drm/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86.
3333

3434
obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o
3535

36+
obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o
37+
3638
drm_cma_helper-y := drm_gem_cma_helper.o
3739
obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o
3840

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
#include "amdgpu_drv.h"
3232

3333
#include <drm/drm_pciids.h>
34-
#include <linux/console.h>
3534
#include <linux/module.h>
3635
#include <linux/pm_runtime.h>
3736
#include <linux/vga_switcheroo.h>
@@ -2516,10 +2515,8 @@ static int __init amdgpu_init(void)
25162515
{
25172516
int r;
25182517

2519-
if (vgacon_text_force()) {
2520-
DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
2518+
if (drm_firmware_drivers_only())
25212519
return -EINVAL;
2522-
}
25232520

25242521
r = amdgpu_sync_init();
25252522
if (r)

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -116,17 +116,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,
116116

117117
abo = ttm_to_amdgpu_bo(bo);
118118
if (abo->flags & AMDGPU_AMDKFD_CREATE_SVM_BO) {
119-
struct dma_fence *fence;
120-
struct dma_resv *resv = &bo->base._resv;
121-
122-
rcu_read_lock();
123-
fence = rcu_dereference(resv->fence_excl);
124-
if (fence && !fence->ops->signaled)
125-
dma_fence_enable_sw_signaling(fence);
126-
127119
placement->num_placement = 0;
128120
placement->num_busy_placement = 0;
129-
rcu_read_unlock();
130121
return;
131122
}
132123

drivers/gpu/drm/ast/ast_drv.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
* Authors: Dave Airlie <[email protected]>
2727
*/
2828

29-
#include <linux/console.h>
3029
#include <linux/module.h>
3130
#include <linux/pci.h>
3231

@@ -233,7 +232,7 @@ static struct pci_driver ast_pci_driver = {
233232

234233
static int __init ast_init(void)
235234
{
236-
if (vgacon_text_force() && ast_modeset == -1)
235+
if (drm_firmware_drivers_only() && ast_modeset == -1)
237236
return -EINVAL;
238237

239238
if (ast_modeset == 0)

drivers/gpu/drm/bridge/analogix/anx7625.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -850,7 +850,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
850850
int count, blocks_num;
851851
u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
852852
u8 i, j;
853-
u8 g_edid_break = 0;
853+
int g_edid_break = 0;
854854
int ret;
855855
struct device *dev = &ctx->client->dev;
856856

@@ -881,7 +881,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
881881
g_edid_break = edid_read(ctx, offset,
882882
pblock_buf);
883883

884-
if (g_edid_break)
884+
if (g_edid_break < 0)
885885
break;
886886

887887
memcpy(&pedid_blocks_buf[offset],
@@ -1636,7 +1636,7 @@ static int anx7625_register_audio(struct device *dev, struct anx7625_data *ctx)
16361636
sizeof(codec_data));
16371637

16381638
if (IS_ERR(ctx->audio_pdev))
1639-
return IS_ERR(ctx->audio_pdev);
1639+
return PTR_ERR(ctx->audio_pdev);
16401640

16411641
DRM_DEV_DEBUG_DRIVER(dev, "bound to %s", HDMI_CODEC_DRV_NAME);
16421642

drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -306,19 +306,10 @@ static void ge_b850v3_lvds_remove(void)
306306
mutex_unlock(&ge_b850v3_lvds_dev_mutex);
307307
}
308308

309-
static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
310-
const struct i2c_device_id *id)
309+
static int ge_b850v3_register(void)
311310
{
311+
struct i2c_client *stdp4028_i2c = ge_b850v3_lvds_ptr->stdp4028_i2c;
312312
struct device *dev = &stdp4028_i2c->dev;
313-
int ret;
314-
315-
ret = ge_b850v3_lvds_init(dev);
316-
317-
if (ret)
318-
return ret;
319-
320-
ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
321-
i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);
322313

323314
/* drm bridge initialization */
324315
ge_b850v3_lvds_ptr->bridge.funcs = &ge_b850v3_lvds_funcs;
@@ -343,6 +334,27 @@ static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
343334
"ge-b850v3-lvds-dp", ge_b850v3_lvds_ptr);
344335
}
345336

337+
static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
338+
const struct i2c_device_id *id)
339+
{
340+
struct device *dev = &stdp4028_i2c->dev;
341+
int ret;
342+
343+
ret = ge_b850v3_lvds_init(dev);
344+
345+
if (ret)
346+
return ret;
347+
348+
ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
349+
i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);
350+
351+
/* Only register after both bridges are probed */
352+
if (!ge_b850v3_lvds_ptr->stdp2690_i2c)
353+
return 0;
354+
355+
return ge_b850v3_register();
356+
}
357+
346358
static int stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
347359
{
348360
ge_b850v3_lvds_remove();
@@ -386,7 +398,11 @@ static int stdp2690_ge_b850v3_fw_probe(struct i2c_client *stdp2690_i2c,
386398
ge_b850v3_lvds_ptr->stdp2690_i2c = stdp2690_i2c;
387399
i2c_set_clientdata(stdp2690_i2c, ge_b850v3_lvds_ptr);
388400

389-
return 0;
401+
/* Only register after both bridges are probed */
402+
if (!ge_b850v3_lvds_ptr->stdp4028_i2c)
403+
return 0;
404+
405+
return ge_b850v3_register();
390406
}
391407

392408
static int stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)

0 commit comments

Comments
 (0)