Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-2021-11-29' of git://anongit.freedesktop.org…
Browse files Browse the repository at this point in the history
…/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 <daniel.vetter@ffwll.ch>

From: Thomas Zimmermann <tzimmermann@suse.de>
Link: https://patchwork.freedesktop.org/patch/msgid/YaSVz15Q7dAlEevU@linux-uq9g.fritz.box
  • Loading branch information
Daniel Vetter committed Dec 9, 2021
2 parents c305ae9 + 69d8461 commit c8a04cb
Show file tree
Hide file tree
Showing 29 changed files with 344 additions and 285 deletions.
7 changes: 7 additions & 0 deletions Documentation/admin-guide/kernel-parameters.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3545,6 +3545,13 @@
shutdown the other cpus. Instead use the REBOOT_VECTOR
irq.

nomodeset Disable kernel modesetting. DRM drivers will not perform
display-mode changes or accelerated rendering. Only the
system framebuffer will be available for use if this was
set-up by the firmware or boot loader.

Useful as fallback, or for testing and debugging.

nomodule Disable module load

nopat [X86] Disable PAT (page attribute table extension of
Expand Down
6 changes: 6 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
menuconfig DRM
tristate "Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)"
depends on (AGP || AGP=n) && !EMULATED_CMPXCHG && HAS_DMA
select DRM_NOMODESET
select DRM_PANEL_ORIENTATION_QUIRKS
select HDMI
select FB_CMDLINE
Expand Down Expand Up @@ -492,6 +493,11 @@ config DRM_EXPORT_FOR_TESTS
config DRM_PANEL_ORIENTATION_QUIRKS
tristate

# Separate option because nomodeset parameter is global and expected built-in
config DRM_NOMODESET
bool
default n

config DRM_LIB_RANDOM
bool
default n
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86.

obj-$(CONFIG_DRM_DP_AUX_BUS) += drm_dp_aux_bus.o

obj-$(CONFIG_DRM_NOMODESET) += drm_nomodeset.o

drm_cma_helper-y := drm_gem_cma_helper.o
obj-$(CONFIG_DRM_GEM_CMA_HELPER) += drm_cma_helper.o

Expand Down
5 changes: 1 addition & 4 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#include "amdgpu_drv.h"

#include <drm/drm_pciids.h>
#include <linux/console.h>
#include <linux/module.h>
#include <linux/pm_runtime.h>
#include <linux/vga_switcheroo.h>
Expand Down Expand Up @@ -2516,10 +2515,8 @@ static int __init amdgpu_init(void)
{
int r;

if (vgacon_text_force()) {
DRM_ERROR("VGACON disables amdgpu kernel modesetting.\n");
if (drm_firmware_drivers_only())
return -EINVAL;
}

r = amdgpu_sync_init();
if (r)
Expand Down
9 changes: 0 additions & 9 deletions drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,17 +116,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo,

abo = ttm_to_amdgpu_bo(bo);
if (abo->flags & AMDGPU_AMDKFD_CREATE_SVM_BO) {
struct dma_fence *fence;
struct dma_resv *resv = &bo->base._resv;

rcu_read_lock();
fence = rcu_dereference(resv->fence_excl);
if (fence && !fence->ops->signaled)
dma_fence_enable_sw_signaling(fence);

placement->num_placement = 0;
placement->num_busy_placement = 0;
rcu_read_unlock();
return;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/gpu/drm/ast/ast_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
* Authors: Dave Airlie <airlied@redhat.com>
*/

#include <linux/console.h>
#include <linux/module.h>
#include <linux/pci.h>

Expand Down Expand Up @@ -233,7 +232,7 @@ static struct pci_driver ast_pci_driver = {

static int __init ast_init(void)
{
if (vgacon_text_force() && ast_modeset == -1)
if (drm_firmware_drivers_only() && ast_modeset == -1)
return -EINVAL;

if (ast_modeset == 0)
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/bridge/analogix/anx7625.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
int count, blocks_num;
u8 pblock_buf[MAX_DPCD_BUFFER_SIZE];
u8 i, j;
u8 g_edid_break = 0;
int g_edid_break = 0;
int ret;
struct device *dev = &ctx->client->dev;

Expand Down Expand Up @@ -881,7 +881,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx,
g_edid_break = edid_read(ctx, offset,
pblock_buf);

if (g_edid_break)
if (g_edid_break < 0)
break;

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

if (IS_ERR(ctx->audio_pdev))
return IS_ERR(ctx->audio_pdev);
return PTR_ERR(ctx->audio_pdev);

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

Expand Down
40 changes: 28 additions & 12 deletions drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,19 +306,10 @@ static void ge_b850v3_lvds_remove(void)
mutex_unlock(&ge_b850v3_lvds_dev_mutex);
}

static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
const struct i2c_device_id *id)
static int ge_b850v3_register(void)
{
struct i2c_client *stdp4028_i2c = ge_b850v3_lvds_ptr->stdp4028_i2c;
struct device *dev = &stdp4028_i2c->dev;
int ret;

ret = ge_b850v3_lvds_init(dev);

if (ret)
return ret;

ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);

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

static int stdp4028_ge_b850v3_fw_probe(struct i2c_client *stdp4028_i2c,
const struct i2c_device_id *id)
{
struct device *dev = &stdp4028_i2c->dev;
int ret;

ret = ge_b850v3_lvds_init(dev);

if (ret)
return ret;

ge_b850v3_lvds_ptr->stdp4028_i2c = stdp4028_i2c;
i2c_set_clientdata(stdp4028_i2c, ge_b850v3_lvds_ptr);

/* Only register after both bridges are probed */
if (!ge_b850v3_lvds_ptr->stdp2690_i2c)
return 0;

return ge_b850v3_register();
}

static int stdp4028_ge_b850v3_fw_remove(struct i2c_client *stdp4028_i2c)
{
ge_b850v3_lvds_remove();
Expand Down Expand Up @@ -386,7 +398,11 @@ static int stdp2690_ge_b850v3_fw_probe(struct i2c_client *stdp2690_i2c,
ge_b850v3_lvds_ptr->stdp2690_i2c = stdp2690_i2c;
i2c_set_clientdata(stdp2690_i2c, ge_b850v3_lvds_ptr);

return 0;
/* Only register after both bridges are probed */
if (!ge_b850v3_lvds_ptr->stdp4028_i2c)
return 0;

return ge_b850v3_register();
}

static int stdp2690_ge_b850v3_fw_remove(struct i2c_client *stdp2690_i2c)
Expand Down
Loading

0 comments on commit c8a04cb

Please sign in to comment.