History

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 <daniel.vetter@ffwll.ch>

Daniel Vetter committed 4 years ago

Commit c8a04cb2 parents c305ae9 69d846129 files · +344 −285Browse files

Unified · Split

29 files
  1. Documentation/admin-guide/kernel-parameters.txt +7 −0
  2. drivers/gpu/drm/Kconfig +6 −0
  3. drivers/gpu/drm/Makefile +2 −0
  4. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +1 −4
  5. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 −9
  6. drivers/gpu/drm/ast/ast_drv.c +1 −2
  7. drivers/gpu/drm/bridge/analogix/anx7625.c +3 −3
  8. drivers/gpu/drm/bridge/megachips-stdpxxxx-ge-b850v3-fw.c +28 −12
  9. drivers/gpu/drm/drm_atomic.c +99 −81
  10. drivers/gpu/drm/drm_atomic_helper.c +134 −109
  11. drivers/gpu/drm/drm_atomic_uapi.c +1 −1
  12. drivers/gpu/drm/drm_auth.c +8 −4
  13. drivers/gpu/drm/drm_nomodeset.c +24 −0
  14. drivers/gpu/drm/drm_panel_orientation_quirks.c +6 −0
  15. drivers/gpu/drm/i915/i915_module.c +2 −2
  16. drivers/gpu/drm/mgag200/mgag200_drv.c +1 −2
  17. drivers/gpu/drm/nouveau/nouveau_drm.c +2 −2
  18. drivers/gpu/drm/qxl/qxl_drv.c +1 −2
  19. drivers/gpu/drm/radeon/radeon_drv.c +2 −7
  20. drivers/gpu/drm/tiny/bochs.c +1 −2
  21. drivers/gpu/drm/tiny/cirrus.c +2 −2
  22. drivers/gpu/drm/ttm/ttm_range_manager.c +7 −4
  23. drivers/gpu/drm/vboxvideo/vbox_drv.c +1 −4
  24. drivers/gpu/drm/vboxvideo/vbox_main.c +2 −2
  25. drivers/gpu/drm/virtio/virtgpu_drv.c +1 −2
  26. drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 −2
  27. drivers/video/console/vgacon.c +0 −21
  28. include/drm/drm_drv.h +1 −0
  29. include/linux/console.h +0 −6
Documentation/admin-guide/kernel-parameters.txt+7−0
@@ -3545,6 +3545,13 @@ · 3544 unmodified lines
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+6−0
@@ -8,6 +8,7 @@ · 7 unmodified lines
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 · 478 unmodified lines
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+2−0
@@ -33,6 +33,8 @@ drm-$(CONFIG_DRM_PRIVACY_SCREEN) += drm_privacy_screen.o drm_privacy_screen_x86. · 32 unmodified lines
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+1−4
@@ -31,7 +31,6 @@ · 30 unmodified lines
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) · 2478 unmodified lines
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+0−9
@@ -116,17 +116,8 @@ static void amdgpu_evict_flags(struct ttm_buffer_object *bo, · 115 unmodified lines
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+1−2
@@ -26,7 +26,6 @@ · 25 unmodified lines
2626 * Authors: Dave Airlie <airlied@redhat.com>
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 = { · 200 unmodified lines
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+3−3
@@ -850,7 +850,7 @@ static int sp_tx_edid_read(struct anx7625_data *ctx, · 849 unmodified lines
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, · 24 unmodified lines
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) · 748 unmodified lines
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+28−12
@@ -306,19 +306,10 @@ out: · 305 unmodified lines
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, · 18 unmodified lines
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, · 37 unmodified lines
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)
drivers/gpu/drm/drm_atomic.c+99−81
@@ -74,7 +74,7 @@ int drm_crtc_commit_wait(struct drm_crtc_commit *commit) · 73 unmodified lines
7474
7575 ret = wait_for_completion_timeout(&commit->hw_done, timeout);
7676 if (!ret) {
77− DRM_ERROR("hw_done timed out\n");
77+ drm_err(commit->crtc->dev, "hw_done timed out\n");
7878 return -ETIMEDOUT;
7979 }
8080
@@ -84,7 +84,7 @@ int drm_crtc_commit_wait(struct drm_crtc_commit *commit) · 3 unmodified lines
8484 */
8585 ret = wait_for_completion_timeout(&commit->flip_done, timeout);
8686 if (!ret) {
87− DRM_ERROR("flip_done timed out\n");
87+ drm_err(commit->crtc->dev, "flip_done timed out\n");
8888 return -ETIMEDOUT;
8989 }
9090
@@ -140,7 +140,7 @@ drm_atomic_state_init(struct drm_device *dev, struct drm_atomic_state *state) · 49 unmodified lines
140140
141141 state->dev = dev;
142142
143− DRM_DEBUG_ATOMIC("Allocated atomic state %p\n", state);
143+ drm_dbg_atomic(dev, "Allocated atomic state %p\n", state);
144144
145145 return 0;
146146 fail:
@@ -191,7 +191,7 @@ void drm_atomic_state_default_clear(struct drm_atomic_state *state) · 44 unmodified lines
191191 struct drm_mode_config *config = &dev->mode_config;
192192 int i;
193193
194− DRM_DEBUG_ATOMIC("Clearing atomic state %p\n", state);
194+ drm_dbg_atomic(dev, "Clearing atomic state %p\n", state);
195195
196196 for (i = 0; i < state->num_connector; i++) {
197197 struct drm_connector *connector = state->connectors[i].ptr;
@@ -301,7 +301,7 @@ void __drm_atomic_state_free(struct kref *ref) · 103 unmodified lines
301301
302302 drm_atomic_state_clear(state);
303303
304− DRM_DEBUG_ATOMIC("Freeing atomic state %p\n", state);
304+ drm_dbg_atomic(state->dev, "Freeing atomic state %p\n", state);
305305
306306 if (config->funcs->atomic_state_free) {
307307 config->funcs->atomic_state_free(state);
@@ -358,8 +358,8 @@ drm_atomic_get_crtc_state(struct drm_atomic_state *state, · 50 unmodified lines
358358 state->crtcs[index].ptr = crtc;
359359 crtc_state->state = state;
360360
361− DRM_DEBUG_ATOMIC("Added [CRTC:%d:%s] %p state to %p\n",
362− crtc->base.id, crtc->name, crtc_state, state);
361+ drm_dbg_atomic(state->dev, "Added [CRTC:%d:%s] %p state to %p\n",
362+ crtc->base.id, crtc->name, crtc_state, state);
363363
364364 return crtc_state;
365365 }
@@ -379,8 +379,9 @@ static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, · 13 unmodified lines
379379 */
380380
381381 if (new_crtc_state->active && !new_crtc_state->enable) {
382− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] active without enabled\n",
383− crtc->base.id, crtc->name);
382+ drm_dbg_atomic(crtc->dev,
383+ "[CRTC:%d:%s] active without enabled\n",
384+ crtc->base.id, crtc->name);
384385 return -EINVAL;
385386 }
386387
@@ -390,15 +391,17 @@ static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, · 3 unmodified lines
390391 */
391392 if (drm_core_check_feature(crtc->dev, DRIVER_ATOMIC) &&
392393 WARN_ON(new_crtc_state->enable && !new_crtc_state->mode_blob)) {
393− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled without mode blob\n",
394− crtc->base.id, crtc->name);
394+ drm_dbg_atomic(crtc->dev,
395+ "[CRTC:%d:%s] enabled without mode blob\n",
396+ crtc->base.id, crtc->name);
395397 return -EINVAL;
396398 }
397399
398400 if (drm_core_check_feature(crtc->dev, DRIVER_ATOMIC) &&
399401 WARN_ON(!new_crtc_state->enable && new_crtc_state->mode_blob)) {
400− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] disabled with mode blob\n",
401− crtc->base.id, crtc->name);
402+ drm_dbg_atomic(crtc->dev,
403+ "[CRTC:%d:%s] disabled with mode blob\n",
404+ crtc->base.id, crtc->name);
402405 return -EINVAL;
403406 }
404407
@@ -414,8 +417,9 @@ static int drm_atomic_crtc_check(const struct drm_crtc_state *old_crtc_state, · 9 unmodified lines
414417 */
415418 if (new_crtc_state->event &&
416419 !new_crtc_state->active && !old_crtc_state->active) {
417− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] requesting event but off\n",
418− crtc->base.id, crtc->name);
420+ drm_dbg_atomic(crtc->dev,
421+ "[CRTC:%d:%s] requesting event but off\n",
422+ crtc->base.id, crtc->name);
419423 return -EINVAL;
420424 }
421425
@@ -460,8 +464,9 @@ static int drm_atomic_connector_check(struct drm_connector *connector, · 38 unmodified lines
460464 return 0;
461465
462466 if (writeback_job->fb && !state->crtc) {
463− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] framebuffer without CRTC\n",
464− connector->base.id, connector->name);
467+ drm_dbg_atomic(connector->dev,
468+ "[CONNECTOR:%d:%s] framebuffer without CRTC\n",
469+ connector->base.id, connector->name);
465470 return -EINVAL;
466471 }
467472
@@ -470,16 +475,18 @@ static int drm_atomic_connector_check(struct drm_connector *connector, · 2 unmodified lines
470475 state->crtc);
471476
472477 if (writeback_job->fb && !crtc_state->active) {
473− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] has framebuffer, but [CRTC:%d] is off\n",
474− connector->base.id, connector->name,
475− state->crtc->base.id);
478+ drm_dbg_atomic(connector->dev,
479+ "[CONNECTOR:%d:%s] has framebuffer, but [CRTC:%d] is off\n",
480+ connector->base.id, connector->name,
481+ state->crtc->base.id);
476482 return -EINVAL;
477483 }
478484
479485 if (!writeback_job->fb) {
480486 if (writeback_job->out_fence) {
481− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n",
482− connector->base.id, connector->name);
487+ drm_dbg_atomic(connector->dev,
488+ "[CONNECTOR:%d:%s] requesting out-fence without framebuffer\n",
489+ connector->base.id, connector->name);
483490 return -EINVAL;
484491 }
485492
@@ -537,8 +544,8 @@ drm_atomic_get_plane_state(struct drm_atomic_state *state, · 51 unmodified lines
537544 state->planes[index].new_state = plane_state;
538545 plane_state->state = state;
539546
540− DRM_DEBUG_ATOMIC("Added [PLANE:%d:%s] %p state to %p\n",
541− plane->base.id, plane->name, plane_state, state);
547+ drm_dbg_atomic(plane->dev, "Added [PLANE:%d:%s] %p state to %p\n",
548+ plane->base.id, plane->name, plane_state, state);
542549
543550 if (plane_state->crtc) {
544551 struct drm_crtc_state *crtc_state;
@@ -594,12 +601,12 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 49 unmodified lines
594601
595602 /* either *both* CRTC and FB must be set, or neither */
596603 if (crtc && !fb) {
597− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] CRTC set but no FB\n",
598− plane->base.id, plane->name);
604+ drm_dbg_atomic(plane->dev, "[PLANE:%d:%s] CRTC set but no FB\n",
605+ plane->base.id, plane->name);
599606 return -EINVAL;
600607 } else if (fb && !crtc) {
601− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] FB set but no CRTC\n",
602− plane->base.id, plane->name);
608+ drm_dbg_atomic(plane->dev, "[PLANE:%d:%s] FB set but no CRTC\n",
609+ plane->base.id, plane->name);
603610 return -EINVAL;
604611 }
605612
@@ -609,9 +616,10 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 3 unmodified lines
609616
610617 /* Check whether this plane is usable on this CRTC */
611618 if (!(plane->possible_crtcs & drm_crtc_mask(crtc))) {
612− DRM_DEBUG_ATOMIC("Invalid [CRTC:%d:%s] for [PLANE:%d:%s]\n",
613− crtc->base.id, crtc->name,
614− plane->base.id, plane->name);
619+ drm_dbg_atomic(plane->dev,
620+ "Invalid [CRTC:%d:%s] for [PLANE:%d:%s]\n",
621+ crtc->base.id, crtc->name,
622+ plane->base.id, plane->name);
615623 return -EINVAL;
616624 }
617625
@@ -619,9 +627,10 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 1 unmodified line
619627 ret = drm_plane_check_pixel_format(plane, fb->format->format,
620628 fb->modifier);
621629 if (ret) {
622− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] invalid pixel format %p4cc, modifier 0x%llx\n",
623− plane->base.id, plane->name,
624− &fb->format->format, fb->modifier);
630+ drm_dbg_atomic(plane->dev,
631+ "[PLANE:%d:%s] invalid pixel format %p4cc, modifier 0x%llx\n",
632+ plane->base.id, plane->name,
633+ &fb->format->format, fb->modifier);
625634 return ret;
626635 }
627636
@@ -630,10 +639,11 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 2 unmodified lines
630639 new_plane_state->crtc_x > INT_MAX - (int32_t) new_plane_state->crtc_w ||
631640 new_plane_state->crtc_h > INT_MAX ||
632641 new_plane_state->crtc_y > INT_MAX - (int32_t) new_plane_state->crtc_h) {
633− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] invalid CRTC coordinates %ux%u+%d+%d\n",
634− plane->base.id, plane->name,
635− new_plane_state->crtc_w, new_plane_state->crtc_h,
636− new_plane_state->crtc_x, new_plane_state->crtc_y);
642+ drm_dbg_atomic(plane->dev,
643+ "[PLANE:%d:%s] invalid CRTC coordinates %ux%u+%d+%d\n",
644+ plane->base.id, plane->name,
645+ new_plane_state->crtc_w, new_plane_state->crtc_h,
646+ new_plane_state->crtc_x, new_plane_state->crtc_y);
637647 return -ERANGE;
638648 }
639649
@@ -645,18 +655,19 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 5 unmodified lines
645655 new_plane_state->src_x > fb_width - new_plane_state->src_w ||
646656 new_plane_state->src_h > fb_height ||
647657 new_plane_state->src_y > fb_height - new_plane_state->src_h) {
648− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] invalid source coordinates "
649− "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n",
650− plane->base.id, plane->name,
651− new_plane_state->src_w >> 16,
652− ((new_plane_state->src_w & 0xffff) * 15625) >> 10,
653− new_plane_state->src_h >> 16,
654− ((new_plane_state->src_h & 0xffff) * 15625) >> 10,
655− new_plane_state->src_x >> 16,
656− ((new_plane_state->src_x & 0xffff) * 15625) >> 10,
657− new_plane_state->src_y >> 16,
658− ((new_plane_state->src_y & 0xffff) * 15625) >> 10,
659− fb->width, fb->height);
658+ drm_dbg_atomic(plane->dev,
659+ "[PLANE:%d:%s] invalid source coordinates "
660+ "%u.%06ux%u.%06u+%u.%06u+%u.%06u (fb %ux%u)\n",
661+ plane->base.id, plane->name,
662+ new_plane_state->src_w >> 16,
663+ ((new_plane_state->src_w & 0xffff) * 15625) >> 10,
664+ new_plane_state->src_h >> 16,
665+ ((new_plane_state->src_h & 0xffff) * 15625) >> 10,
666+ new_plane_state->src_x >> 16,
667+ ((new_plane_state->src_x & 0xffff) * 15625) >> 10,
668+ new_plane_state->src_y >> 16,
669+ ((new_plane_state->src_y & 0xffff) * 15625) >> 10,
670+ fb->width, fb->height);
660671 return -ENOSPC;
661672 }
662673
@@ -671,9 +682,10 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 8 unmodified lines
671682 clips->y1 < 0 ||
672683 clips->x2 > fb_width ||
673684 clips->y2 > fb_height) {
674− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] invalid damage clip %d %d %d %d\n",
675− plane->base.id, plane->name, clips->x1,
676− clips->y1, clips->x2, clips->y2);
685+ drm_dbg_atomic(plane->dev,
686+ "[PLANE:%d:%s] invalid damage clip %d %d %d %d\n",
687+ plane->base.id, plane->name, clips->x1,
688+ clips->y1, clips->x2, clips->y2);
677689 return -EINVAL;
678690 }
679691 clips++;
@@ -681,8 +693,9 @@ static int drm_atomic_plane_check(const struct drm_plane_state *old_plane_state, · 1 unmodified line
681693 }
682694
683695 if (plane_switching_crtc(old_plane_state, new_plane_state)) {
684− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] switching CRTC directly\n",
685− plane->base.id, plane->name);
696+ drm_dbg_atomic(plane->dev,
697+ "[PLANE:%d:%s] switching CRTC directly\n",
698+ plane->base.id, plane->name);
686699 return -EINVAL;
687700 }
688701
@@ -846,8 +859,9 @@ drm_atomic_get_private_obj_state(struct drm_atomic_state *state, · 157 unmodified lines
846859
847860 state->num_private_objs = num_objs;
848861
849− DRM_DEBUG_ATOMIC("Added new private object %p state %p to %p\n",
850− obj, obj_state, state);
862+ drm_dbg_atomic(state->dev,
863+ "Added new private object %p state %p to %p\n",
864+ obj, obj_state, state);
851865
852866 return obj_state;
853867 }
@@ -1027,7 +1041,7 @@ drm_atomic_get_connector_state(struct drm_atomic_state *state, · 173 unmodified lines
10271041 state->connectors[index].ptr = connector;
10281042 connector_state->state = state;
10291043
1030− DRM_DEBUG_ATOMIC("Added [CONNECTOR:%d:%s] %p state to %p\n",
1044+ drm_dbg_atomic(connector->dev, "Added [CONNECTOR:%d:%s] %p state to %p\n",
10311045 connector->base.id, connector->name,
10321046 connector_state, state);
10331047
@@ -1160,8 +1174,9 @@ drm_atomic_add_encoder_bridges(struct drm_atomic_state *state, · 126 unmodified lines
11601174 if (!encoder)
11611175 return 0;
11621176
1163− DRM_DEBUG_ATOMIC("Adding all bridges for [encoder:%d:%s] to %p\n",
1164− encoder->base.id, encoder->name, state);
1177+ drm_dbg_atomic(encoder->dev,
1178+ "Adding all bridges for [encoder:%d:%s] to %p\n",
1179+ encoder->base.id, encoder->name, state);
11651180
11661181 drm_for_each_bridge_in_chain(encoder, bridge) {
11671182 /* Skip bridges that don't implement the atomic state hooks. */
@@ -1213,8 +1228,9 @@ drm_atomic_add_affected_connectors(struct drm_atomic_state *state, · 45 unmodified lines
12131228 if (ret)
12141229 return ret;
12151230
1216− DRM_DEBUG_ATOMIC("Adding all current connectors for [CRTC:%d:%s] to %p\n",
1217− crtc->base.id, crtc->name, state);
1231+ drm_dbg_atomic(crtc->dev,
1232+ "Adding all current connectors for [CRTC:%d:%s] to %p\n",
1233+ crtc->base.id, crtc->name, state);
12181234
12191235 /*
12201236 * Changed connectors are already in @state, so only need to look
@@ -1267,8 +1283,9 @@ drm_atomic_add_affected_planes(struct drm_atomic_state *state, · 46 unmodified lines
12671283
12681284 WARN_ON(!drm_atomic_get_new_crtc_state(state, crtc));
12691285
1270− DRM_DEBUG_ATOMIC("Adding all current planes for [CRTC:%d:%s] to %p\n",
1271− crtc->base.id, crtc->name, state);
1286+ drm_dbg_atomic(crtc->dev,
1287+ "Adding all current planes for [CRTC:%d:%s] to %p\n",
1288+ crtc->base.id, crtc->name, state);
12721289
12731290 drm_for_each_plane_mask(plane, state->dev, old_crtc_state->plane_mask) {
12741291 struct drm_plane_state *plane_state =
@@ -1308,7 +1325,7 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 33 unmodified lines
13081325 unsigned int affected_crtc = 0;
13091326 int i, ret = 0;
13101327
1311− DRM_DEBUG_ATOMIC("checking %p\n", state);
1328+ drm_dbg_atomic(dev, "checking %p\n", state);
13121329
13131330 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i)
13141331 requested_crtc |= drm_crtc_mask(crtc);
@@ -1316,8 +1333,8 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 1 unmodified line
13161333 for_each_oldnew_plane_in_state(state, plane, old_plane_state, new_plane_state, i) {
13171334 ret = drm_atomic_plane_check(old_plane_state, new_plane_state);
13181335 if (ret) {
1319− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] atomic core check failed\n",
1320− plane->base.id, plane->name);
1336+ drm_dbg_atomic(dev, "[PLANE:%d:%s] atomic core check failed\n",
1337+ plane->base.id, plane->name);
13211338 return ret;
13221339 }
13231340 }
@@ -1325,8 +1342,8 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 1 unmodified line
13251342 for_each_oldnew_crtc_in_state(state, crtc, old_crtc_state, new_crtc_state, i) {
13261343 ret = drm_atomic_crtc_check(old_crtc_state, new_crtc_state);
13271344 if (ret) {
1328− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] atomic core check failed\n",
1329− crtc->base.id, crtc->name);
1345+ drm_dbg_atomic(dev, "[CRTC:%d:%s] atomic core check failed\n",
1346+ crtc->base.id, crtc->name);
13301347 return ret;
13311348 }
13321349 }
@@ -1334,8 +1351,8 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 1 unmodified line
13341351 for_each_new_connector_in_state(state, conn, conn_state, i) {
13351352 ret = drm_atomic_connector_check(conn, conn_state);
13361353 if (ret) {
1337− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] atomic core check failed\n",
1338− conn->base.id, conn->name);
1354+ drm_dbg_atomic(dev, "[CONNECTOR:%d:%s] atomic core check failed\n",
1355+ conn->base.id, conn->name);
13391356 return ret;
13401357 }
13411358 }
@@ -1344,8 +1361,8 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 2 unmodified lines
13441361 ret = config->funcs->atomic_check(state->dev, state);
13451362
13461363 if (ret) {
1347− DRM_DEBUG_ATOMIC("atomic driver check for %p failed: %d\n",
1348− state, ret);
1364+ drm_dbg_atomic(dev, "atomic driver check for %p failed: %d\n",
1365+ state, ret);
13491366 return ret;
13501367 }
13511368 }
@@ -1353,8 +1370,8 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 1 unmodified line
13531370 if (!state->allow_modeset) {
13541371 for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
13551372 if (drm_atomic_crtc_needs_modeset(new_crtc_state)) {
1356− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] requires full modeset\n",
1357− crtc->base.id, crtc->name);
1373+ drm_dbg_atomic(dev, "[CRTC:%d:%s] requires full modeset\n",
1374+ crtc->base.id, crtc->name);
13581375 return -EINVAL;
13591376 }
13601377 }
@@ -1374,8 +1391,9 @@ int drm_atomic_check_only(struct drm_atomic_state *state) · 13 unmodified lines
13741391 * so compositors know what's going on.
13751392 */
13761393 if (affected_crtc != requested_crtc) {
1377− DRM_DEBUG_ATOMIC("driver added CRTC to commit: requested 0x%x, affected 0x%0x\n",
1378− requested_crtc, affected_crtc);
1394+ drm_dbg_atomic(dev,
1395+ "driver added CRTC to commit: requested 0x%x, affected 0x%0x\n",
1396+ requested_crtc, affected_crtc);
13791397 WARN(!state->allow_modeset, "adding CRTC not allowed without modesets: requested 0x%x, affected 0x%0x\n",
13801398 requested_crtc, affected_crtc);
13811399 }
@@ -1407,7 +1425,7 @@ int drm_atomic_commit(struct drm_atomic_state *state) · 25 unmodified lines
14071425 if (ret)
14081426 return ret;
14091427
1410− DRM_DEBUG_ATOMIC("committing %p\n", state);
1428+ drm_dbg_atomic(state->dev, "committing %p\n", state);
14111429
14121430 return config->funcs->atomic_commit(state->dev, state, false);
14131431 }
@@ -1436,7 +1454,7 @@ int drm_atomic_nonblocking_commit(struct drm_atomic_state *state) · 22 unmodified lines
14361454 if (ret)
14371455 return ret;
14381456
1439− DRM_DEBUG_ATOMIC("committing %p nonblocking\n", state);
1457+ drm_dbg_atomic(state->dev, "committing %p nonblocking\n", state);
14401458
14411459 return config->funcs->atomic_commit(state->dev, state, true);
14421460 }
@@ -1633,11 +1651,11 @@ void drm_atomic_print_new_state(const struct drm_atomic_state *state, · 190 unmodified lines
16331651 int i;
16341652
16351653 if (!p) {
1636− DRM_ERROR("invalid drm printer\n");
1654+ drm_err(state->dev, "invalid drm printer\n");
16371655 return;
16381656 }
16391657
1640− DRM_DEBUG_ATOMIC("checking %p\n", state);
1658+ drm_dbg_atomic(state->dev, "checking %p\n", state);
16411659
16421660 for_each_new_plane_in_state(state, plane, plane_state, i)
16431661 drm_atomic_plane_print_state(p, plane_state);
drivers/gpu/drm/drm_atomic_helper.c+134−109
@@ -132,9 +132,10 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, · 131 unmodified lines
132132
133133 if (new_encoder) {
134134 if (encoder_mask & drm_encoder_mask(new_encoder)) {
135− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] on [CONNECTOR:%d:%s] already assigned\n",
136− new_encoder->base.id, new_encoder->name,
137− connector->base.id, connector->name);
135+ drm_dbg_atomic(connector->dev,
136+ "[ENCODER:%d:%s] on [CONNECTOR:%d:%s] already assigned\n",
137+ new_encoder->base.id, new_encoder->name,
138+ connector->base.id, connector->name);
138139
139140 return -EINVAL;
140141 }
@@ -169,11 +170,12 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, · 28 unmodified lines
169170 continue;
170171
171172 if (!disable_conflicting_encoders) {
172− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s] by [CONNECTOR:%d:%s]\n",
173− encoder->base.id, encoder->name,
174− connector->state->crtc->base.id,
175− connector->state->crtc->name,
176− connector->base.id, connector->name);
173+ drm_dbg_atomic(connector->dev,
174+ "[ENCODER:%d:%s] in use on [CRTC:%d:%s] by [CONNECTOR:%d:%s]\n",
175+ encoder->base.id, encoder->name,
176+ connector->state->crtc->base.id,
177+ connector->state->crtc->name,
178+ connector->base.id, connector->name);
177179 ret = -EINVAL;
178180 goto out;
179181 }
@@ -184,10 +186,11 @@ static int handle_conflicting_encoders(struct drm_atomic_state *state, · 4 unmodified lines
184186 goto out;
185187 }
186188
187− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s], disabling [CONNECTOR:%d:%s]\n",
188− encoder->base.id, encoder->name,
189− new_conn_state->crtc->base.id, new_conn_state->crtc->name,
190− connector->base.id, connector->name);
189+ drm_dbg_atomic(connector->dev,
190+ "[ENCODER:%d:%s] in use on [CRTC:%d:%s], disabling [CONNECTOR:%d:%s]\n",
191+ encoder->base.id, encoder->name,
192+ new_conn_state->crtc->base.id, new_conn_state->crtc->name,
193+ connector->base.id, connector->name);
191194
192195 crtc_state = drm_atomic_get_new_crtc_state(state, new_conn_state->crtc);
193196
@@ -268,9 +271,10 @@ steal_encoder(struct drm_atomic_state *state, · 74 unmodified lines
268271
269272 encoder_crtc = old_connector_state->crtc;
270273
271− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] in use on [CRTC:%d:%s], stealing it\n",
272− encoder->base.id, encoder->name,
273− encoder_crtc->base.id, encoder_crtc->name);
274+ drm_dbg_atomic(encoder->dev,
275+ "[ENCODER:%d:%s] in use on [CRTC:%d:%s], stealing it\n",
276+ encoder->base.id, encoder->name,
277+ encoder_crtc->base.id, encoder_crtc->name);
274278
275279 set_best_encoder(state, new_connector_state, NULL);
276280
@@ -291,9 +295,8 @@ update_connector_routing(struct drm_atomic_state *state, · 14 unmodified lines
291295 struct drm_encoder *new_encoder;
292296 struct drm_crtc_state *crtc_state;
293297
294− DRM_DEBUG_ATOMIC("Updating routing for [CONNECTOR:%d:%s]\n",
295− connector->base.id,
296− connector->name);
298+ drm_dbg_atomic(connector->dev, "Updating routing for [CONNECTOR:%d:%s]\n",
299+ connector->base.id, connector->name);
297300
298301 if (old_connector_state->crtc != new_connector_state->crtc) {
299302 if (old_connector_state->crtc) {
@@ -308,9 +311,8 @@ update_connector_routing(struct drm_atomic_state *state, · 8 unmodified lines
308311 }
309312
310313 if (!new_connector_state->crtc) {
311− DRM_DEBUG_ATOMIC("Disabling [CONNECTOR:%d:%s]\n",
312− connector->base.id,
313− connector->name);
314+ drm_dbg_atomic(connector->dev, "Disabling [CONNECTOR:%d:%s]\n",
315+ connector->base.id, connector->name);
314316
315317 set_best_encoder(state, new_connector_state, NULL);
316318
@@ -339,8 +341,9 @@ update_connector_routing(struct drm_atomic_state *state, · 22 unmodified lines
339341 */
340342 if (!state->duplicated && drm_connector_is_unregistered(connector) &&
341343 crtc_state->active) {
342− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] is not registered\n",
343− connector->base.id, connector->name);
344+ drm_dbg_atomic(connector->dev,
345+ "[CONNECTOR:%d:%s] is not registered\n",
346+ connector->base.id, connector->name);
344347 return -EINVAL;
345348 }
346349
@@ -354,31 +357,33 @@ update_connector_routing(struct drm_atomic_state *state, · 7 unmodified lines
354357 new_encoder = drm_connector_get_single_encoder(connector);
355358
356359 if (!new_encoder) {
357− DRM_DEBUG_ATOMIC("No suitable encoder found for [CONNECTOR:%d:%s]\n",
358− connector->base.id,
359− connector->name);
360+ drm_dbg_atomic(connector->dev,
361+ "No suitable encoder found for [CONNECTOR:%d:%s]\n",
362+ connector->base.id, connector->name);
360363 return -EINVAL;
361364 }
362365
363366 if (!drm_encoder_crtc_ok(new_encoder, new_connector_state->crtc)) {
364− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] incompatible with [CRTC:%d:%s]\n",
365− new_encoder->base.id,
366− new_encoder->name,
367− new_connector_state->crtc->base.id,
368− new_connector_state->crtc->name);
367+ drm_dbg_atomic(connector->dev,
368+ "[ENCODER:%d:%s] incompatible with [CRTC:%d:%s]\n",
369+ new_encoder->base.id,
370+ new_encoder->name,
371+ new_connector_state->crtc->base.id,
372+ new_connector_state->crtc->name);
369373 return -EINVAL;
370374 }
371375
372376 if (new_encoder == new_connector_state->best_encoder) {
373377 set_best_encoder(state, new_connector_state, new_encoder);
374378
375− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d:%s]\n",
376− connector->base.id,
377− connector->name,
378− new_encoder->base.id,
379− new_encoder->name,
380− new_connector_state->crtc->base.id,
381− new_connector_state->crtc->name);
379+ drm_dbg_atomic(connector->dev,
380+ "[CONNECTOR:%d:%s] keeps [ENCODER:%d:%s], now on [CRTC:%d:%s]\n",
381+ connector->base.id,
382+ connector->name,
383+ new_encoder->base.id,
384+ new_encoder->name,
385+ new_connector_state->crtc->base.id,
386+ new_connector_state->crtc->name);
382387
383388 return 0;
384389 }
@@ -389,13 +394,14 @@ update_connector_routing(struct drm_atomic_state *state, · 4 unmodified lines
389394
390395 crtc_state->connectors_changed = true;
391396
392− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n",
393− connector->base.id,
394− connector->name,
395− new_encoder->base.id,
396− new_encoder->name,
397− new_connector_state->crtc->base.id,
398− new_connector_state->crtc->name);
397+ drm_dbg_atomic(connector->dev,
398+ "[CONNECTOR:%d:%s] using [ENCODER:%d:%s] on [CRTC:%d:%s]\n",
399+ connector->base.id,
400+ connector->name,
401+ new_encoder->base.id,
402+ new_encoder->name,
403+ new_connector_state->crtc->base.id,
404+ new_connector_state->crtc->name);
399405
400406 return 0;
401407 }
@@ -443,7 +449,7 @@ mode_fixup(struct drm_atomic_state *state) · 41 unmodified lines
443449 new_crtc_state,
444450 new_conn_state);
445451 if (ret) {
446− DRM_DEBUG_ATOMIC("Bridge atomic check failed\n");
452+ drm_dbg_atomic(encoder->dev, "Bridge atomic check failed\n");
447453 return ret;
448454 }
449455
@@ -451,16 +457,18 @@ mode_fixup(struct drm_atomic_state *state) · 1 unmodified line
451457 ret = funcs->atomic_check(encoder, new_crtc_state,
452458 new_conn_state);
453459 if (ret) {
454− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] check failed\n",
455− encoder->base.id, encoder->name);
460+ drm_dbg_atomic(encoder->dev,
461+ "[ENCODER:%d:%s] check failed\n",
462+ encoder->base.id, encoder->name);
456463 return ret;
457464 }
458465 } else if (funcs && funcs->mode_fixup) {
459466 ret = funcs->mode_fixup(encoder, &new_crtc_state->mode,
460467 &new_crtc_state->adjusted_mode);
461468 if (!ret) {
462− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] fixup failed\n",
463− encoder->base.id, encoder->name);
469+ drm_dbg_atomic(encoder->dev,
470+ "[ENCODER:%d:%s] fixup failed\n",
471+ encoder->base.id, encoder->name);
464472 return -EINVAL;
465473 }
466474 }
@@ -483,8 +491,8 @@ mode_fixup(struct drm_atomic_state *state) · 16 unmodified lines
483491 ret = funcs->mode_fixup(crtc, &new_crtc_state->mode,
484492 &new_crtc_state->adjusted_mode);
485493 if (!ret) {
486− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] fixup failed\n",
487− crtc->base.id, crtc->name);
494+ drm_dbg_atomic(crtc->dev, "[CRTC:%d:%s] fixup failed\n",
495+ crtc->base.id, crtc->name);
488496 return -EINVAL;
489497 }
490498 }
@@ -502,8 +510,9 @@ static enum drm_mode_status mode_valid_path(struct drm_connector *connector, · 11 unmodified lines
502510
503511 ret = drm_encoder_mode_valid(encoder, mode);
504512 if (ret != MODE_OK) {
505− DRM_DEBUG_ATOMIC("[ENCODER:%d:%s] mode_valid() failed\n",
506− encoder->base.id, encoder->name);
513+ drm_dbg_atomic(encoder->dev,
514+ "[ENCODER:%d:%s] mode_valid() failed\n",
515+ encoder->base.id, encoder->name);
507516 return ret;
508517 }
509518
@@ -511,14 +520,14 @@ static enum drm_mode_status mode_valid_path(struct drm_connector *connector, · 1 unmodified line
511520 ret = drm_bridge_chain_mode_valid(bridge, &connector->display_info,
512521 mode);
513522 if (ret != MODE_OK) {
514− DRM_DEBUG_ATOMIC("[BRIDGE] mode_valid() failed\n");
523+ drm_dbg_atomic(encoder->dev, "[BRIDGE] mode_valid() failed\n");
515524 return ret;
516525 }
517526
518527 ret = drm_crtc_mode_valid(crtc, mode);
519528 if (ret != MODE_OK) {
520− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode_valid() failed\n",
521− crtc->base.id, crtc->name);
529+ drm_dbg_atomic(encoder->dev, "[CRTC:%d:%s] mode_valid() failed\n",
530+ crtc->base.id, crtc->name);
522531 return ret;
523532 }
524533
@@ -619,14 +628,14 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, · 94 unmodified lines
619628 WARN_ON(!drm_modeset_is_locked(&crtc->mutex));
620629
621630 if (!drm_mode_equal(&old_crtc_state->mode, &new_crtc_state->mode)) {
622− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] mode changed\n",
623− crtc->base.id, crtc->name);
631+ drm_dbg_atomic(dev, "[CRTC:%d:%s] mode changed\n",
632+ crtc->base.id, crtc->name);
624633 new_crtc_state->mode_changed = true;
625634 }
626635
627636 if (old_crtc_state->enable != new_crtc_state->enable) {
628− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enable changed\n",
629− crtc->base.id, crtc->name);
637+ drm_dbg_atomic(dev, "[CRTC:%d:%s] enable changed\n",
638+ crtc->base.id, crtc->name);
630639
631640 /*
632641 * For clarity this assignment is done here, but
@@ -641,14 +650,14 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, · 8 unmodified lines
641650 }
642651
643652 if (old_crtc_state->active != new_crtc_state->active) {
644− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] active changed\n",
645− crtc->base.id, crtc->name);
653+ drm_dbg_atomic(dev, "[CRTC:%d:%s] active changed\n",
654+ crtc->base.id, crtc->name);
646655 new_crtc_state->active_changed = true;
647656 }
648657
649658 if (new_crtc_state->enable != has_connectors) {
650− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] enabled/connectors mismatch\n",
651− crtc->base.id, crtc->name);
659+ drm_dbg_atomic(dev, "[CRTC:%d:%s] enabled/connectors mismatch\n",
660+ crtc->base.id, crtc->name);
652661
653662 return -EINVAL;
654663 }
@@ -708,10 +717,11 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, · 53 unmodified lines
708717 if (!drm_atomic_crtc_needs_modeset(new_crtc_state))
709718 continue;
710719
711− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] needs all connectors, enable: %c, active: %c\n",
712− crtc->base.id, crtc->name,
713− new_crtc_state->enable ? 'y' : 'n',
714− new_crtc_state->active ? 'y' : 'n');
720+ drm_dbg_atomic(dev,
721+ "[CRTC:%d:%s] needs all connectors, enable: %c, active: %c\n",
722+ crtc->base.id, crtc->name,
723+ new_crtc_state->enable ? 'y' : 'n',
724+ new_crtc_state->active ? 'y' : 'n');
715725
716726 ret = drm_atomic_add_affected_connectors(state, crtc);
717727 if (ret != 0)
@@ -818,7 +828,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, · 100 unmodified lines
818828 }
819829
820830 if (!crtc_state->enable && !can_update_disabled) {
821− DRM_DEBUG_KMS("Cannot update plane of a disabled CRTC.\n");
831+ drm_dbg_kms(plane_state->crtc->dev,
832+ "Cannot update plane of a disabled CRTC.\n");
822833 return -EINVAL;
823834 }
824835
@@ -828,7 +839,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, · 3 unmodified lines
828839 hscale = drm_rect_calc_hscale(src, dst, min_scale, max_scale);
829840 vscale = drm_rect_calc_vscale(src, dst, min_scale, max_scale);
830841 if (hscale < 0 || vscale < 0) {
831− DRM_DEBUG_KMS("Invalid scaling of plane\n");
842+ drm_dbg_kms(plane_state->crtc->dev,
843+ "Invalid scaling of plane\n");
832844 drm_rect_debug_print("src: ", &plane_state->src, true);
833845 drm_rect_debug_print("dst: ", &plane_state->dst, false);
834846 return -ERANGE;
@@ -852,7 +864,8 @@ int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, · 17 unmodified lines
852864 return 0;
853865
854866 if (!can_position && !drm_rect_equals(dst, &clip)) {
855− DRM_DEBUG_KMS("Plane must cover entire CRTC\n");
867+ drm_dbg_kms(plane_state->crtc->dev,
868+ "Plane must cover entire CRTC\n");
856869 drm_rect_debug_print("dst: ", dst, false);
857870 drm_rect_debug_print("clip: ", &clip, false);
858871 return -EINVAL;
@@ -904,8 +917,9 @@ drm_atomic_helper_check_planes(struct drm_device *dev, · 45 unmodified lines
904917
905918 ret = funcs->atomic_check(plane, state);
906919 if (ret) {
907− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] atomic driver check failed\n",
908− plane->base.id, plane->name);
920+ drm_dbg_atomic(plane->dev,
921+ "[PLANE:%d:%s] atomic driver check failed\n",
922+ plane->base.id, plane->name);
909923 return ret;
910924 }
911925 }
@@ -920,8 +934,9 @@ drm_atomic_helper_check_planes(struct drm_device *dev, · 8 unmodified lines
920934
921935 ret = funcs->atomic_check(crtc, state);
922936 if (ret) {
923− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] atomic driver check failed\n",
924− crtc->base.id, crtc->name);
937+ drm_dbg_atomic(crtc->dev,
938+ "[CRTC:%d:%s] atomic driver check failed\n",
939+ crtc->base.id, crtc->name);
925940 return ret;
926941 }
927942 }
@@ -1049,8 +1064,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) · 121 unmodified lines
10491064
10501065 funcs = encoder->helper_private;
10511066
1052− DRM_DEBUG_ATOMIC("disabling [ENCODER:%d:%s]\n",
1053− encoder->base.id, encoder->name);
1067+ drm_dbg_atomic(dev, "disabling [ENCODER:%d:%s]\n",
1068+ encoder->base.id, encoder->name);
10541069
10551070 /*
10561071 * Each encoder has at most one connector (since we always steal
@@ -1087,8 +1102,8 @@ disable_outputs(struct drm_device *dev, struct drm_atomic_state *old_state) · 30 unmodified lines
10871102
10881103 funcs = crtc->helper_private;
10891104
1090− DRM_DEBUG_ATOMIC("disabling [CRTC:%d:%s]\n",
1091− crtc->base.id, crtc->name);
1105+ drm_dbg_atomic(dev, "disabling [CRTC:%d:%s]\n",
1106+ crtc->base.id, crtc->name);
10921107
10931108
10941109 /* Right function depends upon target state. */
@@ -1229,8 +1244,8 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state) · 134 unmodified lines
12291244 funcs = crtc->helper_private;
12301245
12311246 if (new_crtc_state->enable && funcs->mode_set_nofb) {
1232− DRM_DEBUG_ATOMIC("modeset on [CRTC:%d:%s]\n",
1233− crtc->base.id, crtc->name);
1247+ drm_dbg_atomic(dev, "modeset on [CRTC:%d:%s]\n",
1248+ crtc->base.id, crtc->name);
12341249
12351250 funcs->mode_set_nofb(crtc);
12361251 }
@@ -1254,8 +1269,8 @@ crtc_set_mode(struct drm_device *dev, struct drm_atomic_state *old_state) · 17 unmodified lines
12541269 if (!new_crtc_state->mode_changed)
12551270 continue;
12561271
1257− DRM_DEBUG_ATOMIC("modeset on [ENCODER:%d:%s]\n",
1258− encoder->base.id, encoder->name);
1272+ drm_dbg_atomic(dev, "modeset on [ENCODER:%d:%s]\n",
1273+ encoder->base.id, encoder->name);
12591274
12601275 /*
12611276 * Each encoder has at most one connector (since we always steal
@@ -1357,8 +1372,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, · 95 unmodified lines
13571372 funcs = crtc->helper_private;
13581373
13591374 if (new_crtc_state->enable) {
1360− DRM_DEBUG_ATOMIC("enabling [CRTC:%d:%s]\n",
1361− crtc->base.id, crtc->name);
1375+ drm_dbg_atomic(dev, "enabling [CRTC:%d:%s]\n",
1376+ crtc->base.id, crtc->name);
13621377 if (funcs->atomic_enable)
13631378 funcs->atomic_enable(crtc, old_state);
13641379 else if (funcs->commit)
@@ -1381,8 +1396,8 @@ void drm_atomic_helper_commit_modeset_enables(struct drm_device *dev, · 16 unmodified lines
13811396 encoder = new_conn_state->best_encoder;
13821397 funcs = encoder->helper_private;
13831398
1384− DRM_DEBUG_ATOMIC("enabling [ENCODER:%d:%s]\n",
1385− encoder->base.id, encoder->name);
1399+ drm_dbg_atomic(dev, "enabling [ENCODER:%d:%s]\n",
1400+ encoder->base.id, encoder->name);
13861401
13871402 /*
13881403 * Each encoder has at most one connector (since we always steal
@@ -1551,8 +1566,8 @@ void drm_atomic_helper_wait_for_flip_done(struct drm_device *dev, · 162 unmodified lines
15511566
15521567 ret = wait_for_completion_timeout(&commit->flip_done, 10 * HZ);
15531568 if (ret == 0)
1554− DRM_ERROR("[CRTC:%d:%s] flip_done timed out\n",
1555− crtc->base.id, crtc->name);
1569+ drm_err(dev, "[CRTC:%d:%s] flip_done timed out\n",
1570+ crtc->base.id, crtc->name);
15561571 }
15571572
15581573 if (old_state->fake_commit)
@@ -1739,8 +1754,9 @@ int drm_atomic_helper_async_check(struct drm_device *dev, · 180 unmodified lines
17391754 */
17401755 if (old_plane_state->commit &&
17411756 !try_wait_for_completion(&old_plane_state->commit->hw_done)) {
1742− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] inflight previous commit preventing async commit\n",
1743− plane->base.id, plane->name);
1757+ drm_dbg_atomic(dev,
1758+ "[PLANE:%d:%s] inflight previous commit preventing async commit\n",
1759+ plane->base.id, plane->name);
17441760 return -EBUSY;
17451761 }
17461762
@@ -1962,8 +1978,9 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) · 215 unmodified lines
19621978 */
19631979 if (!completed && nonblock) {
19641980 spin_unlock(&crtc->commit_lock);
1965− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] busy with a previous commit\n",
1966− crtc->base.id, crtc->name);
1981+ drm_dbg_atomic(crtc->dev,
1982+ "[CRTC:%d:%s] busy with a previous commit\n",
1983+ crtc->base.id, crtc->name);
19671984
19681985 return -EBUSY;
19691986 }
@@ -1985,8 +2002,8 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) · 15 unmodified lines
19852002 ret = wait_for_completion_interruptible_timeout(&stall_commit->cleanup_done,
19862003 10*HZ);
19872004 if (ret == 0)
1988− DRM_ERROR("[CRTC:%d:%s] cleanup_done timed out\n",
1989− crtc->base.id, crtc->name);
2005+ drm_err(crtc->dev, "[CRTC:%d:%s] cleanup_done timed out\n",
2006+ crtc->base.id, crtc->name);
19902007
19912008 drm_crtc_commit_put(stall_commit);
19922009
@@ -2150,8 +2167,9 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, · 157 unmodified lines
21502167 */
21512168 if (nonblock && old_conn_state->commit &&
21522169 !try_wait_for_completion(&old_conn_state->commit->flip_done)) {
2153− DRM_DEBUG_ATOMIC("[CONNECTOR:%d:%s] busy with a previous commit\n",
2154− conn->base.id, conn->name);
2170+ drm_dbg_atomic(conn->dev,
2171+ "[CONNECTOR:%d:%s] busy with a previous commit\n",
2172+ conn->base.id, conn->name);
21552173
21562174 return -EBUSY;
21572175 }
@@ -2171,8 +2189,9 @@ int drm_atomic_helper_setup_commit(struct drm_atomic_state *state, · 13 unmodified lines
21712189 */
21722190 if (nonblock && old_plane_state->commit &&
21732191 !try_wait_for_completion(&old_plane_state->commit->flip_done)) {
2174− DRM_DEBUG_ATOMIC("[PLANE:%d:%s] busy with a previous commit\n",
2175− plane->base.id, plane->name);
2192+ drm_dbg_atomic(plane->dev,
2193+ "[PLANE:%d:%s] busy with a previous commit\n",
2194+ plane->base.id, plane->name);
21762195
21772196 return -EBUSY;
21782197 }
@@ -2218,22 +2237,25 @@ void drm_atomic_helper_wait_for_dependencies(struct drm_atomic_state *old_state) · 39 unmodified lines
22182237 for_each_old_crtc_in_state(old_state, crtc, old_crtc_state, i) {
22192238 ret = drm_crtc_commit_wait(old_crtc_state->commit);
22202239 if (ret)
2221− DRM_ERROR("[CRTC:%d:%s] commit wait timed out\n",
2222− crtc->base.id, crtc->name);
2240+ drm_err(crtc->dev,
2241+ "[CRTC:%d:%s] commit wait timed out\n",
2242+ crtc->base.id, crtc->name);
22232243 }
22242244
22252245 for_each_old_connector_in_state(old_state, conn, old_conn_state, i) {
22262246 ret = drm_crtc_commit_wait(old_conn_state->commit);
22272247 if (ret)
2228− DRM_ERROR("[CONNECTOR:%d:%s] commit wait timed out\n",
2229− conn->base.id, conn->name);
2248+ drm_err(conn->dev,
2249+ "[CONNECTOR:%d:%s] commit wait timed out\n",
2250+ conn->base.id, conn->name);
22302251 }
22312252
22322253 for_each_old_plane_in_state(old_state, plane, old_plane_state, i) {
22332254 ret = drm_crtc_commit_wait(old_plane_state->commit);
22342255 if (ret)
2235− DRM_ERROR("[PLANE:%d:%s] commit wait timed out\n",
2236− plane->base.id, plane->name);
2256+ drm_err(plane->dev,
2257+ "[PLANE:%d:%s] commit wait timed out\n",
2258+ plane->base.id, plane->name);
22372259 }
22382260 }
22392261 EXPORT_SYMBOL(drm_atomic_helper_wait_for_dependencies);
@@ -3120,7 +3142,9 @@ void drm_atomic_helper_shutdown(struct drm_device *dev) · 880 unmodified lines
31203142
31213143 ret = drm_atomic_helper_disable_all(dev, &ctx);
31223144 if (ret)
3123− DRM_ERROR("Disabling all crtc's during unload failed with %i\n", ret);
3145+ drm_err(dev,
3146+ "Disabling all crtc's during unload failed with %i\n",
3147+ ret);
31243148
31253149 DRM_MODESET_LOCK_ALL_END(dev, ctx, ret);
31263150 }
@@ -3380,8 +3404,9 @@ static int page_flip_common(struct drm_atomic_state *state, · 253 unmodified lines
33803404 /* Make sure we don't accidentally do a full modeset. */
33813405 state->allow_modeset = false;
33823406 if (!crtc_state->active) {
3383− DRM_DEBUG_ATOMIC("[CRTC:%d:%s] disabled, rejecting legacy flip\n",
3384− crtc->base.id, crtc->name);
3407+ drm_dbg_atomic(crtc->dev,
3408+ "[CRTC:%d:%s] disabled, rejecting legacy flip\n",
3409+ crtc->base.id, crtc->name);
33853410 return -EINVAL;
33863411 }
33873412
drivers/gpu/drm/drm_atomic_uapi.c+1−1
@@ -773,7 +773,7 @@ static int drm_atomic_connector_set_property(struct drm_connector *connector, · 772 unmodified lines
773773 state->scaling_mode = val;
774774 } else if (property == config->content_protection_property) {
775775 if (val == DRM_MODE_CONTENT_PROTECTION_ENABLED) {
776− DRM_DEBUG_KMS("only drivers can set CP Enabled\n");
776+ drm_dbg_kms(dev, "only drivers can set CP Enabled\n");
777777 return -EINVAL;
778778 }
779779 state->content_protection = val;
drivers/gpu/drm/drm_auth.c+8−4
@@ -106,7 +106,7 @@ int drm_getmagic(struct drm_device *dev, void *data, struct drm_file *file_priv) · 105 unmodified lines
106106 auth->magic = file_priv->magic;
107107 mutex_unlock(&dev->master_mutex);
108108
109− DRM_DEBUG("%u\n", auth->magic);
109+ drm_dbg_core(dev, "%u\n", auth->magic);
110110
111111 return ret < 0 ? ret : 0;
112112 }
@@ -117,7 +117,7 @@ int drm_authmagic(struct drm_device *dev, void *data, · 4 unmodified lines
117117 struct drm_auth *auth = data;
118118 struct drm_file *file;
119119
120− DRM_DEBUG("%u\n", auth->magic);
120+ drm_dbg_core(dev, "%u\n", auth->magic);
121121
122122 mutex_lock(&dev->master_mutex);
123123 file = idr_find(&file_priv->master->magic_map, auth->magic);
@@ -274,7 +274,9 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data, · 150 unmodified lines
274274 }
275275
276276 if (file_priv->master->lessor != NULL) {
277− DRM_DEBUG_LEASE("Attempt to set lessee %d as master\n", file_priv->master->lessee_id);
277+ drm_dbg_lease(dev,
278+ "Attempt to set lessee %d as master\n",
279+ file_priv->master->lessee_id);
278280 ret = -EINVAL;
279281 goto out_unlock;
280282 }
@@ -315,7 +317,9 @@ int drm_dropmaster_ioctl(struct drm_device *dev, void *data, · 34 unmodified lines
315317 }
316318
317319 if (file_priv->master->lessor != NULL) {
318− DRM_DEBUG_LEASE("Attempt to drop lessee %d as master\n", file_priv->master->lessee_id);
320+ drm_dbg_lease(dev,
321+ "Attempt to drop lessee %d as master\n",
322+ file_priv->master->lessee_id);
319323 ret = -EINVAL;
320324 goto out_unlock;
321325 }
drivers/gpu/drm/drm_nomodeset.c+24−0
@@ -0,0 +1,24 @@
1+// SPDX-License-Identifier: GPL-2.0
2+
3+#include <linux/module.h>
4+#include <linux/types.h>
5+
6+static bool drm_nomodeset;
7+
8+bool drm_firmware_drivers_only(void)
9+{
10+ return drm_nomodeset;
11+}
12+EXPORT_SYMBOL(drm_firmware_drivers_only);
13+
14+static int __init disable_modeset(char *str)
15+{
16+ drm_nomodeset = true;
17+
18+ pr_warn("Booted with the nomodeset parameter. Only the system framebuffer will be available\n");
19+
20+ return 1;
21+}
22+
23+/* Disable kernel modesetting */
24+__setup("nomodeset", disable_modeset);
drivers/gpu/drm/drm_panel_orientation_quirks.c+6−0
@@ -262,6 +262,12 @@ static const struct dmi_system_id orientation_data[] = { · 261 unmodified lines
262262 DMI_EXACT_MATCH(DMI_PRODUCT_VERSION, "Lenovo ideapad D330-10IGM"),
263263 },
264264 .driver_data = (void *)&lcd1200x1920_rightside_up,
265+ }, { /* Lenovo Yoga Book X90F / X91F / X91L */
266+ .matches = {
267+ /* Non exact match to match all versions */
268+ DMI_MATCH(DMI_PRODUCT_NAME, "Lenovo YB1-X9"),
269+ },
270+ .driver_data = (void *)&lcd1200x1920_rightside_up,
265271 }, { /* OneGX1 Pro */
266272 .matches = {
267273 DMI_EXACT_MATCH(DMI_SYS_VENDOR, "SYSTEM_MANUFACTURER"),
drivers/gpu/drm/i915/i915_module.c+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 * Copyright © 2021 Intel Corporation
55 */
66
7−#include <linux/console.h>
7+#include <drm/drm_drv.h>
88
99 #include "gem/i915_gem_context.h"
1010 #include "gem/i915_gem_object.h"
@@ -31,7 +31,7 @@ static int i915_check_nomodeset(void) · 20 unmodified lines
3131 if (i915_modparams.modeset == 0)
3232 use_kms = false;
3333
34− if (vgacon_text_force() && i915_modparams.modeset == -1)
34+ if (drm_firmware_drivers_only() && i915_modparams.modeset == -1)
3535 use_kms = false;
3636
3737 if (!use_kms) {
drivers/gpu/drm/mgag200/mgag200_drv.c+1−2
@@ -6,7 +6,6 @@ · 5 unmodified lines
66 * Dave Airlie
77 */
88
9−#include <linux/console.h>
109 #include <linux/module.h>
1110 #include <linux/pci.h>
1211 #include <linux/vmalloc.h>
@@ -378,7 +377,7 @@ static struct pci_driver mgag200_pci_driver = { · 365 unmodified lines
378377
379378 static int __init mgag200_init(void)
380379 {
381− if (vgacon_text_force() && mgag200_modeset == -1)
380+ if (drm_firmware_drivers_only() && mgag200_modeset == -1)
382381 return -EINVAL;
383382
384383 if (mgag200_modeset == 0)
drivers/gpu/drm/nouveau/nouveau_drm.c+2−2
@@ -22,7 +22,6 @@ · 21 unmodified lines
2222 * Authors: Ben Skeggs
2323 */
2424
25−#include <linux/console.h>
2625 #include <linux/delay.h>
2726 #include <linux/module.h>
2827 #include <linux/pci.h>
@@ -32,6 +31,7 @@ · 3 unmodified lines
3231
3332 #include <drm/drm_aperture.h>
3433 #include <drm/drm_crtc_helper.h>
34+#include <drm/drm_drv.h>
3535 #include <drm/drm_gem_ttm_helper.h>
3636 #include <drm/drm_ioctl.h>
3737 #include <drm/drm_vblank.h>
@@ -1358,7 +1358,7 @@ nouveau_drm_init(void) · 1320 unmodified lines
13581358 nouveau_display_options();
13591359
13601360 if (nouveau_modeset == -1) {
1361− if (vgacon_text_force())
1361+ if (drm_firmware_drivers_only())
13621362 nouveau_modeset = 0;
13631363 }
13641364
drivers/gpu/drm/qxl/qxl_drv.c+1−2
@@ -29,7 +29,6 @@ · 28 unmodified lines
2929
3030 #include "qxl_drv.h"
3131
32−#include <linux/console.h>
3332 #include <linux/module.h>
3433 #include <linux/pci.h>
3534 #include <linux/vgaarb.h>
@@ -295,7 +294,7 @@ static struct drm_driver qxl_driver = { · 259 unmodified lines
295294
296295 static int __init qxl_init(void)
297296 {
298− if (vgacon_text_force() && qxl_modeset == -1)
297+ if (drm_firmware_drivers_only() && qxl_modeset == -1)
299298 return -EINVAL;
300299
301300 if (qxl_modeset == 0)
drivers/gpu/drm/radeon/radeon_drv.c+2−7
@@ -31,7 +31,6 @@ · 30 unmodified lines
3131
3232
3333 #include <linux/compat.h>
34−#include <linux/console.h>
3534 #include <linux/module.h>
3635 #include <linux/pm_runtime.h>
3736 #include <linux/vga_switcheroo.h>
@@ -637,15 +636,11 @@ static struct pci_driver radeon_kms_pci_driver = { · 599 unmodified lines
637636
638637 static int __init radeon_module_init(void)
639638 {
640− if (vgacon_text_force() && radeon_modeset == -1) {
641− DRM_INFO("VGACON disable radeon kernel modesetting.\n");
639+ if (drm_firmware_drivers_only() && radeon_modeset == -1)
642640 radeon_modeset = 0;
643− }
644641
645− if (radeon_modeset == 0) {
646− DRM_ERROR("No UMS support in radeon module!\n");
642+ if (radeon_modeset == 0)
647643 return -EINVAL;
648− }
649644
650645 DRM_INFO("radeon kernel modesetting enabled.\n");
651646 radeon_register_atpx_handler();
drivers/gpu/drm/tiny/bochs.c+1−2
@@ -1,6 +1,5 @@
11 // SPDX-License-Identifier: GPL-2.0-or-later
22
3−#include <linux/console.h>
43 #include <linux/pci.h>
54
65 #include <drm/drm_aperture.h>
@@ -719,7 +718,7 @@ static struct pci_driver bochs_pci_driver = { · 712 unmodified lines
719718
720719 static int __init bochs_init(void)
721720 {
722− if (vgacon_text_force() && bochs_modeset == -1)
721+ if (drm_firmware_drivers_only() && bochs_modeset == -1)
723722 return -EINVAL;
724723
725724 if (bochs_modeset == 0)
drivers/gpu/drm/tiny/cirrus.c+2−2
@@ -16,7 +16,6 @@ · 15 unmodified lines
1616 * Copyright 1999-2001 Jeff Garzik <jgarzik@pobox.com>
1717 */
1818
19−#include <linux/console.h>
2019 #include <linux/dma-buf-map.h>
2120 #include <linux/module.h>
2221 #include <linux/pci.h>
@@ -636,8 +635,9 @@ static struct pci_driver cirrus_pci_driver = { · 613 unmodified lines
636635
637636 static int __init cirrus_init(void)
638637 {
639− if (vgacon_text_force())
638+ if (drm_firmware_drivers_only())
640639 return -EINVAL;
640+
641641 return pci_register_driver(&cirrus_pci_driver);
642642 }
643643
drivers/gpu/drm/ttm/ttm_range_manager.c+7−4
@@ -128,15 +128,17 @@ static const struct ttm_resource_manager_func ttm_range_manager_func = { · 127 unmodified lines
128128 };
129129
130130 /**
131− * ttm_range_man_init
131+ * ttm_range_man_init_nocheck - Initialise a generic range manager for the
132+ * selected memory type.
132133 *
133134 * @bdev: ttm device
134135 * @type: memory manager type
135136 * @use_tt: if the memory manager uses tt
136137 * @p_size: size of area to be managed in pages.
137138 *
138− * Initialise a generic range manager for the selected memory type.
139139 * The range manager is installed for this device in the type slot.
140+ *
141+ * Return: %0 on success or a negative error code on failure
140142 */
141143 int ttm_range_man_init_nocheck(struct ttm_device *bdev,
142144 unsigned type, bool use_tt,
@@ -166,12 +168,13 @@ int ttm_range_man_init_nocheck(struct ttm_device *bdev, · 23 unmodified lines
166168 EXPORT_SYMBOL(ttm_range_man_init_nocheck);
167169
168170 /**
169− * ttm_range_man_fini
171+ * ttm_range_man_fini_nocheck - Remove the generic range manager from a slot
172+ * and tear it down.
170173 *
171174 * @bdev: ttm device
172175 * @type: memory manager type
173176 *
174− * Remove the generic range manager from a slot and tear it down.
177+ * Return: %0 on success or a negative error code on failure
175178 */
176179 int ttm_range_man_fini_nocheck(struct ttm_device *bdev,
177180 unsigned type)
drivers/gpu/drm/vboxvideo/vbox_drv.c+1−4
@@ -7,7 +7,6 @@ · 6 unmodified lines
77 * Michael Thayer <michael.thayer@oracle.com,
88 * Hans de Goede <hdegoede@redhat.com>
99 */
10−#include <linux/console.h>
1110 #include <linux/module.h>
1211 #include <linux/pci.h>
1312 #include <linux/vt_kern.h>
@@ -193,10 +192,8 @@ static const struct drm_driver driver = { · 179 unmodified lines
193192
194193 static int __init vbox_init(void)
195194 {
196−#ifdef CONFIG_VGA_CONSOLE
197− if (vgacon_text_force() && vbox_modeset == -1)
195+ if (drm_firmware_drivers_only() && vbox_modeset == -1)
198196 return -EINVAL;
199−#endif
200197
201198 if (vbox_modeset == 0)
202199 return -EINVAL;
drivers/gpu/drm/vboxvideo/vbox_main.c+2−2
@@ -127,8 +127,8 @@ int vbox_hw_init(struct vbox_private *vbox) · 126 unmodified lines
127127 /* Create guest-heap mem-pool use 2^4 = 16 byte chunks */
128128 vbox->guest_pool = devm_gen_pool_create(vbox->ddev.dev, 4, -1,
129129 "vboxvideo-accel");
130− if (!vbox->guest_pool)
131− return -ENOMEM;
130+ if (IS_ERR(vbox->guest_pool))
131+ return PTR_ERR(vbox->guest_pool);
132132
133133 ret = gen_pool_add_virt(vbox->guest_pool,
134134 (unsigned long)vbox->guest_heap,
drivers/gpu/drm/virtio/virtgpu_drv.c+1−2
@@ -27,7 +27,6 @@ · 26 unmodified lines
2727 */
2828
2929 #include <linux/module.h>
30−#include <linux/console.h>
3130 #include <linux/pci.h>
3231 #include <linux/poll.h>
3332 #include <linux/wait.h>
@@ -104,7 +103,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev) · 70 unmodified lines
104103 struct drm_device *dev;
105104 int ret;
106105
107− if (vgacon_text_force() && virtio_gpu_modeset == -1)
106+ if (drm_firmware_drivers_only() && virtio_gpu_modeset == -1)
108107 return -EINVAL;
109108
110109 if (virtio_gpu_modeset == 0)
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c+1−2
@@ -25,7 +25,6 @@ · 24 unmodified lines
2525 *
2626 **************************************************************************/
2727
28−#include <linux/console.h>
2928 #include <linux/dma-mapping.h>
3029 #include <linux/module.h>
3130 #include <linux/pci.h>
@@ -1651,7 +1650,7 @@ static int __init vmwgfx_init(void) · 1619 unmodified lines
16511650 {
16521651 int ret;
16531652
1654− if (vgacon_text_force())
1653+ if (drm_firmware_drivers_only())
16551654 return -EINVAL;
16561655
16571656 ret = pci_register_driver(&vmw_pci_driver);
drivers/video/console/vgacon.c+0−21
@@ -97,30 +97,9 @@ static int vga_video_font_height; · 96 unmodified lines
9797 static int vga_scan_lines __read_mostly;
9898 static unsigned int vga_rolled_over; /* last vc_origin offset before wrap */
9999
100−static bool vgacon_text_mode_force;
101100 static bool vga_hardscroll_enabled;
102101 static bool vga_hardscroll_user_enable = true;
103102
104−bool vgacon_text_force(void)
105−{
106− return vgacon_text_mode_force;
107−}
108−EXPORT_SYMBOL(vgacon_text_force);
109−
110−static int __init text_mode(char *str)
111−{
112− vgacon_text_mode_force = true;
113−
114− pr_warn("You have booted with nomodeset. This means your GPU drivers are DISABLED\n");
115− pr_warn("Any video related functionality will be severely degraded, and you may not even be able to suspend the system properly\n");
116− pr_warn("Unless you actually understand what nomodeset does, you should reboot without enabling it\n");
117−
118− return 1;
119−}
120−
121−/* force text mode - used by kernel modesetting */
122−__setup("nomodeset", text_mode);
123−
124103 static int __init no_scroll(char *str)
125104 {
126105 /*
include/drm/drm_drv.h+1−0
@@ -601,5 +601,6 @@ static inline bool drm_drv_uses_atomic_modeset(struct drm_device *dev) · 600 unmodified lines
601601
602602 int drm_dev_set_unique(struct drm_device *dev, const char *name);
603603
604+extern bool drm_firmware_drivers_only(void);
604605
605606 #endif
include/linux/console.h+0−6
@@ -219,12 +219,6 @@ extern atomic_t ignore_console_lock_warning; · 218 unmodified lines
219219 #define VESA_HSYNC_SUSPEND 2
220220 #define VESA_POWERDOWN 3
221221
222−#ifdef CONFIG_VGA_CONSOLE
223−extern bool vgacon_text_force(void);
224−#else
225−static inline bool vgacon_text_force(void) { return false; }
226−#endif
227−
228222 extern void console_init(void);
229223
230224 /* For deferred console takeover */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t