Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'du-next-20210105' of git://linuxtv.org/pinchartl/media into drm-next

- Add default modes for connectors in unknown state
- R-Car DU conversion to DRM-managed API
- R-Car DU miscellaneous fixes
- Miscellaneous bridge and bridge bindings fixes
- Assorted misc driver cleanups
- Constify drm_driver for PCI devices

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/X/P8IOrVXkTpLeCm@pendragon.ideasonboard.com

+209 -226
+3 -3
Documentation/devicetree/bindings/display/bridge/renesas,lvds.yaml
··· 83 83 $ref: /schemas/types.yaml#/definitions/phandle 84 84 description: 85 85 phandle to the companion LVDS encoder. This property is mandatory 86 - for the first LVDS encoder on D3 and E3 SoCs, and shall point to 87 - the second encoder to be used as a companion in dual-link mode. It 88 - shall not be set for any other LVDS encoder. 86 + for the first LVDS encoder on R-Car D3 and E3, and RZ/G2E SoCs, and shall 87 + point to the second encoder to be used as a companion in dual-link mode. 88 + It shall not be set for any other LVDS encoder. 89 89 90 90 required: 91 91 - compatible
+11 -5
Documentation/devicetree/bindings/display/bridge/thine,thc63lvd1024.yaml
··· 30 30 This device has four video ports. Their connections are modeled using the 31 31 OF graph bindings specified in Documentation/devicetree/bindings/graph.txt. 32 32 33 - The device can operate in single-link mode or dual-link mode. In 34 - single-link mode, all pixels are received on port@0, and port@1 shall not 35 - contain any endpoint. In dual-link mode, even-numbered pixels are 36 - received on port@0 and odd-numbered pixels on port@1, and both port@0 and 37 - port@1 shall contain endpoints. 33 + The device can operate in single or dual input and output modes. 34 + 35 + When operating in single input mode, all pixels are received on port@0, 36 + and port@1 shall not contain any endpoint. In dual input mode, 37 + even-numbered pixels are received on port@0 and odd-numbered pixels on 38 + port@1, and both port@0 and port@1 shall contain endpoints. 39 + 40 + When operating in single output mode all pixels are output from the first 41 + CMOS/TTL port and port@3 shall not contain any endpoint. In dual output 42 + mode pixels are output from both CMOS/TTL ports and both port@2 and 43 + port@3 shall contain endpoints. 38 44 39 45 properties: 40 46 '#address-cells':
+2 -7
drivers/gpu/drm/arc/arcpgu_crtc.c
··· 162 162 .atomic_update = arc_pgu_plane_atomic_update, 163 163 }; 164 164 165 - static void arc_pgu_plane_destroy(struct drm_plane *plane) 166 - { 167 - drm_plane_cleanup(plane); 168 - } 169 - 170 165 static const struct drm_plane_funcs arc_pgu_plane_funcs = { 171 166 .update_plane = drm_atomic_helper_update_plane, 172 167 .disable_plane = drm_atomic_helper_disable_plane, 173 - .destroy = arc_pgu_plane_destroy, 168 + .destroy = drm_plane_cleanup, 174 169 .reset = drm_atomic_helper_plane_reset, 175 170 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, 176 171 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state, ··· 208 213 ret = drm_crtc_init_with_planes(drm, &arcpgu->crtc, primary, NULL, 209 214 &arc_pgu_crtc_funcs, NULL); 210 215 if (ret) { 211 - arc_pgu_plane_destroy(primary); 216 + drm_plane_cleanup(primary); 212 217 return ret; 213 218 } 214 219
+1 -1
drivers/gpu/drm/arc/arcpgu_drv.c
··· 145 145 } 146 146 #endif 147 147 148 - static struct drm_driver arcpgu_drm_driver = { 148 + static const struct drm_driver arcpgu_drm_driver = { 149 149 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_ATOMIC, 150 150 .name = "arcpgu", 151 151 .desc = "ARC PGU Controller",
+2 -4
drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
··· 1292 1292 1293 1293 err_unregister_cec: 1294 1294 i2c_unregister_device(adv7511->i2c_cec); 1295 - if (adv7511->cec_clk) 1296 - clk_disable_unprepare(adv7511->cec_clk); 1295 + clk_disable_unprepare(adv7511->cec_clk); 1297 1296 err_i2c_unregister_packet: 1298 1297 i2c_unregister_device(adv7511->i2c_packet); 1299 1298 err_i2c_unregister_edid: ··· 1310 1311 if (adv7511->type == ADV7533 || adv7511->type == ADV7535) 1311 1312 adv7533_detach_dsi(adv7511); 1312 1313 i2c_unregister_device(adv7511->i2c_cec); 1313 - if (adv7511->cec_clk) 1314 - clk_disable_unprepare(adv7511->cec_clk); 1314 + clk_disable_unprepare(adv7511->cec_clk); 1315 1315 1316 1316 adv7511_uninit_regulators(adv7511); 1317 1317
+2 -4
drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
··· 3440 3440 3441 3441 err_iahb: 3442 3442 clk_disable_unprepare(hdmi->iahb_clk); 3443 - if (hdmi->cec_clk) 3444 - clk_disable_unprepare(hdmi->cec_clk); 3443 + clk_disable_unprepare(hdmi->cec_clk); 3445 3444 err_isfr: 3446 3445 clk_disable_unprepare(hdmi->isfr_clk); 3447 3446 err_res: ··· 3464 3465 3465 3466 clk_disable_unprepare(hdmi->iahb_clk); 3466 3467 clk_disable_unprepare(hdmi->isfr_clk); 3467 - if (hdmi->cec_clk) 3468 - clk_disable_unprepare(hdmi->cec_clk); 3468 + clk_disable_unprepare(hdmi->cec_clk); 3469 3469 3470 3470 if (hdmi->i2c) 3471 3471 i2c_del_adapter(&hdmi->i2c->adap);
+1 -1
drivers/gpu/drm/bridge/thc63lvd1024.c
··· 202 202 thc63->dev = &pdev->dev; 203 203 platform_set_drvdata(pdev, thc63); 204 204 205 - thc63->vcc = devm_regulator_get_optional(thc63->dev, "vcc"); 205 + thc63->vcc = devm_regulator_get(thc63->dev, "vcc"); 206 206 if (IS_ERR(thc63->vcc)) { 207 207 if (PTR_ERR(thc63->vcc) == -EPROBE_DEFER) 208 208 return -EPROBE_DEFER;
-4
drivers/gpu/drm/drm_drv.c
··· 589 589 590 590 kref_init(&dev->ref); 591 591 dev->dev = get_device(parent); 592 - #ifdef CONFIG_DRM_LEGACY 593 - dev->driver = (struct drm_driver *)driver; 594 - #else 595 592 dev->driver = driver; 596 - #endif 597 593 598 594 INIT_LIST_HEAD(&dev->managed.resources); 599 595 spin_lock_init(&dev->managed.lock);
+5 -3
drivers/gpu/drm/drm_dumb_buffers.c
··· 29 29 #include <drm/drm_mode.h> 30 30 31 31 #include "drm_crtc_internal.h" 32 + #include "drm_internal.h" 32 33 33 34 /** 34 35 * DOC: overview ··· 47 46 * KMS frame buffers. 48 47 * 49 48 * To support dumb objects drivers must implement the &drm_driver.dumb_create 50 - * operation. &drm_driver.dumb_destroy defaults to drm_gem_dumb_destroy() if 51 - * not set and &drm_driver.dumb_map_offset defaults to 52 - * drm_gem_dumb_map_offset(). See the callbacks for further details. 49 + * and &drm_driver.dumb_map_offset operations (the latter defaults to 50 + * drm_gem_dumb_map_offset() if not set). Drivers that don't use GEM handles 51 + * additionally need to implement the &drm_driver.dumb_destroy operation. See 52 + * the callbacks for further details. 53 53 * 54 54 * Note that dumb objects may not be used for gpu acceleration, as has been 55 55 * attempted on some ARM embedded platforms. Such drivers really must have
+1 -11
drivers/gpu/drm/drm_gem.c
··· 335 335 } 336 336 EXPORT_SYMBOL_GPL(drm_gem_dumb_map_offset); 337 337 338 - /** 339 - * drm_gem_dumb_destroy - dumb fb callback helper for gem based drivers 340 - * @file: drm file-private structure to remove the dumb handle from 341 - * @dev: corresponding drm_device 342 - * @handle: the dumb handle to remove 343 - * 344 - * This implements the &drm_driver.dumb_destroy kms driver callback for drivers 345 - * which use gem to manage their backing storage. 346 - */ 347 338 int drm_gem_dumb_destroy(struct drm_file *file, 348 339 struct drm_device *dev, 349 - uint32_t handle) 340 + u32 handle) 350 341 { 351 342 return drm_gem_handle_delete(file, handle); 352 343 } 353 - EXPORT_SYMBOL(drm_gem_dumb_destroy); 354 344 355 345 /** 356 346 * drm_gem_handle_create_tail - internal functions to create a handle
+3
drivers/gpu/drm/drm_internal.h
··· 191 191 int drm_gem_vmap(struct drm_gem_object *obj, struct dma_buf_map *map); 192 192 void drm_gem_vunmap(struct drm_gem_object *obj, struct dma_buf_map *map); 193 193 194 + int drm_gem_dumb_destroy(struct drm_file *file, struct drm_device *dev, 195 + u32 handle); 196 + 194 197 /* drm_debugfs.c drm_debugfs_crc.c */ 195 198 #if defined(CONFIG_DEBUG_FS) 196 199 int drm_debugfs_init(struct drm_minor *minor, int minor_id,
+22 -11
drivers/gpu/drm/drm_pci.c
··· 24 24 25 25 #include <linux/dma-mapping.h> 26 26 #include <linux/export.h> 27 + #include <linux/list.h> 28 + #include <linux/mutex.h> 27 29 #include <linux/pci.h> 28 30 #include <linux/slab.h> 29 31 ··· 38 36 #include "drm_legacy.h" 39 37 40 38 #ifdef CONFIG_DRM_LEGACY 39 + /* List of devices hanging off drivers with stealth attach. */ 40 + static LIST_HEAD(legacy_dev_list); 41 + static DEFINE_MUTEX(legacy_dev_list_lock); 41 42 42 43 /** 43 44 * drm_pci_alloc - Allocate a PCI consistent memory block, for DMA. ··· 201 196 202 197 static int drm_get_pci_dev(struct pci_dev *pdev, 203 198 const struct pci_device_id *ent, 204 - struct drm_driver *driver) 199 + const struct drm_driver *driver) 205 200 { 206 201 struct drm_device *dev; 207 202 int ret; ··· 230 225 if (ret) 231 226 goto err_agp; 232 227 233 - /* No locking needed since shadow-attach is single-threaded since it may 234 - * only be called from the per-driver module init hook. */ 235 - if (drm_core_check_feature(dev, DRIVER_LEGACY)) 236 - list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list); 228 + if (drm_core_check_feature(dev, DRIVER_LEGACY)) { 229 + mutex_lock(&legacy_dev_list_lock); 230 + list_add_tail(&dev->legacy_dev_list, &legacy_dev_list); 231 + mutex_unlock(&legacy_dev_list_lock); 232 + } 237 233 238 234 return 0; 239 235 ··· 255 249 * 256 250 * Return: 0 on success or a negative error code on failure. 257 251 */ 258 - int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver) 252 + int drm_legacy_pci_init(const struct drm_driver *driver, 253 + struct pci_driver *pdriver) 259 254 { 260 255 struct pci_dev *pdev = NULL; 261 256 const struct pci_device_id *pid; ··· 268 261 return -EINVAL; 269 262 270 263 /* If not using KMS, fall back to stealth mode manual scanning. */ 271 - INIT_LIST_HEAD(&driver->legacy_dev_list); 272 264 for (i = 0; pdriver->id_table[i].vendor != 0; i++) { 273 265 pid = &pdriver->id_table[i]; 274 266 ··· 301 295 * Unregister a DRM driver shadow-attached through drm_legacy_pci_init(). This 302 296 * is deprecated and only used by dri1 drivers. 303 297 */ 304 - void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver) 298 + void drm_legacy_pci_exit(const struct drm_driver *driver, 299 + struct pci_driver *pdriver) 305 300 { 306 301 struct drm_device *dev, *tmp; 307 302 ··· 311 304 if (!(driver->driver_features & DRIVER_LEGACY)) { 312 305 WARN_ON(1); 313 306 } else { 314 - list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list, 307 + mutex_lock(&legacy_dev_list_lock); 308 + list_for_each_entry_safe(dev, tmp, &legacy_dev_list, 315 309 legacy_dev_list) { 316 - list_del(&dev->legacy_dev_list); 317 - drm_put_dev(dev); 310 + if (dev->driver == driver) { 311 + list_del(&dev->legacy_dev_list); 312 + drm_put_dev(dev); 313 + } 318 314 } 315 + mutex_unlock(&legacy_dev_list_lock); 319 316 } 320 317 DRM_INFO("Module unloaded\n"); 321 318 }
+2 -1
drivers/gpu/drm/drm_probe_helper.c
··· 515 515 if (count == 0 && connector->status == connector_status_connected) 516 516 count = drm_add_override_edid_modes(connector); 517 517 518 - if (count == 0 && connector->status == connector_status_connected) 518 + if (count == 0 && (connector->status == connector_status_connected || 519 + connector->status == connector_status_unknown)) 519 520 count = drm_add_modes_noedid(connector, 1024, 768); 520 521 count += drm_helper_probe_add_cmdline_mode(connector); 521 522 if (count == 0)
+1 -1
drivers/gpu/drm/kmb/kmb_drv.c
··· 400 400 401 401 DEFINE_DRM_GEM_CMA_FOPS(fops); 402 402 403 - static struct drm_driver kmb_driver = { 403 + static const struct drm_driver kmb_driver = { 404 404 .driver_features = DRIVER_GEM | 405 405 DRIVER_MODESET | DRIVER_ATOMIC, 406 406 .irq_handler = kmb_isr,
+1 -1
drivers/gpu/drm/rcar-du/rcar_cmm.c
··· 122 122 { 123 123 int ret; 124 124 125 - ret = pm_runtime_get_sync(&pdev->dev); 125 + ret = pm_runtime_resume_and_get(&pdev->dev); 126 126 if (ret < 0) 127 127 return ret; 128 128
+3 -9
drivers/gpu/drm/rcar-du/rcar_du_crtc.c
··· 730 730 */ 731 731 if (rcdu->info->lvds_clk_mask & BIT(rcrtc->index) && 732 732 rstate->outputs == BIT(RCAR_DU_OUTPUT_DPAD0)) { 733 - struct rcar_du_encoder *encoder = 734 - rcdu->encoders[RCAR_DU_OUTPUT_LVDS0 + rcrtc->index]; 733 + struct drm_bridge *bridge = rcdu->lvds[rcrtc->index]; 735 734 const struct drm_display_mode *mode = 736 735 &crtc->state->adjusted_mode; 737 - struct drm_bridge *bridge; 738 736 739 - bridge = drm_bridge_chain_get_first_bridge(&encoder->base); 740 737 rcar_lvds_clk_enable(bridge, mode->clock * 1000); 741 738 } 742 739 ··· 761 764 762 765 if (rcdu->info->lvds_clk_mask & BIT(rcrtc->index) && 763 766 rstate->outputs == BIT(RCAR_DU_OUTPUT_DPAD0)) { 764 - struct rcar_du_encoder *encoder = 765 - rcdu->encoders[RCAR_DU_OUTPUT_LVDS0 + rcrtc->index]; 766 - struct drm_bridge *bridge; 767 + struct drm_bridge *bridge = rcdu->lvds[rcrtc->index]; 767 768 768 769 /* 769 770 * Disable the LVDS clock output, see 770 771 * rcar_du_crtc_atomic_enable(). 771 772 */ 772 - bridge = drm_bridge_chain_get_first_bridge(&encoder->base); 773 773 rcar_lvds_clk_disable(bridge); 774 774 } 775 775 ··· 1250 1256 else 1251 1257 primary = &rgrp->planes[swindex % 2].plane; 1252 1258 1253 - ret = drm_crtc_init_with_planes(rcdu->ddev, crtc, primary, NULL, 1259 + ret = drm_crtc_init_with_planes(&rcdu->ddev, crtc, primary, NULL, 1254 1260 rcdu->info->gen <= 2 ? 1255 1261 &crtc_funcs_gen2 : &crtc_funcs_gen3, 1256 1262 NULL);
+13 -20
drivers/gpu/drm/rcar-du/rcar_du_drv.c
··· 18 18 #include <linux/wait.h> 19 19 20 20 #include <drm/drm_atomic_helper.h> 21 + #include <drm/drm_drv.h> 21 22 #include <drm/drm_fb_cma_helper.h> 22 23 #include <drm/drm_fb_helper.h> 23 - #include <drm/drm_drv.h> 24 24 #include <drm/drm_gem_cma_helper.h> 25 + #include <drm/drm_managed.h> 25 26 #include <drm/drm_probe_helper.h> 26 27 27 28 #include "rcar_du_drv.h" ··· 528 527 { 529 528 struct rcar_du_device *rcdu = dev_get_drvdata(dev); 530 529 531 - return drm_mode_config_helper_suspend(rcdu->ddev); 530 + return drm_mode_config_helper_suspend(&rcdu->ddev); 532 531 } 533 532 534 533 static int rcar_du_pm_resume(struct device *dev) 535 534 { 536 535 struct rcar_du_device *rcdu = dev_get_drvdata(dev); 537 536 538 - return drm_mode_config_helper_resume(rcdu->ddev); 537 + return drm_mode_config_helper_resume(&rcdu->ddev); 539 538 } 540 539 #endif 541 540 ··· 550 549 static int rcar_du_remove(struct platform_device *pdev) 551 550 { 552 551 struct rcar_du_device *rcdu = platform_get_drvdata(pdev); 553 - struct drm_device *ddev = rcdu->ddev; 552 + struct drm_device *ddev = &rcdu->ddev; 554 553 555 554 drm_dev_unregister(ddev); 556 555 ··· 564 563 static int rcar_du_probe(struct platform_device *pdev) 565 564 { 566 565 struct rcar_du_device *rcdu; 567 - struct drm_device *ddev; 568 566 struct resource *mem; 569 567 int ret; 570 568 571 569 /* Allocate and initialize the R-Car device structure. */ 572 - rcdu = devm_kzalloc(&pdev->dev, sizeof(*rcdu), GFP_KERNEL); 573 - if (rcdu == NULL) 574 - return -ENOMEM; 570 + rcdu = devm_drm_dev_alloc(&pdev->dev, &rcar_du_driver, 571 + struct rcar_du_device, ddev); 572 + if (IS_ERR(rcdu)) 573 + return PTR_ERR(rcdu); 575 574 576 575 rcdu->dev = &pdev->dev; 577 576 rcdu->info = of_device_get_match_data(rcdu->dev); ··· 585 584 return PTR_ERR(rcdu->mmio); 586 585 587 586 /* DRM/KMS objects */ 588 - ddev = drm_dev_alloc(&rcar_du_driver, &pdev->dev); 589 - if (IS_ERR(ddev)) 590 - return PTR_ERR(ddev); 591 - 592 - rcdu->ddev = ddev; 593 - ddev->dev_private = rcdu; 594 - 595 587 ret = rcar_du_modeset_init(rcdu); 596 588 if (ret < 0) { 597 589 if (ret != -EPROBE_DEFER) ··· 593 599 goto error; 594 600 } 595 601 596 - ddev->irq_enabled = 1; 602 + rcdu->ddev.irq_enabled = 1; 597 603 598 604 /* 599 605 * Register the DRM device with the core and the connectors with 600 606 * sysfs. 601 607 */ 602 - ret = drm_dev_register(ddev, 0); 608 + ret = drm_dev_register(&rcdu->ddev, 0); 603 609 if (ret) 604 610 goto error; 605 611 606 612 DRM_INFO("Device %s probed\n", dev_name(&pdev->dev)); 607 613 608 - drm_fbdev_generic_setup(ddev, 32); 614 + drm_fbdev_generic_setup(&rcdu->ddev, 32); 609 615 610 616 return 0; 611 617 612 618 error: 613 - rcar_du_remove(pdev); 614 - 619 + drm_kms_helper_poll_fini(&rcdu->ddev); 615 620 return ret; 616 621 } 617 622
+11 -5
drivers/gpu/drm/rcar-du/rcar_du_drv.h
··· 13 13 #include <linux/kernel.h> 14 14 #include <linux/wait.h> 15 15 16 + #include <drm/drm_device.h> 17 + 16 18 #include "rcar_cmm.h" 17 19 #include "rcar_du_crtc.h" 18 20 #include "rcar_du_group.h" ··· 22 20 23 21 struct clk; 24 22 struct device; 25 - struct drm_device; 23 + struct drm_bridge; 26 24 struct drm_property; 27 25 struct rcar_du_device; 28 - struct rcar_du_encoder; 29 26 30 27 #define RCAR_DU_FEATURE_CRTC_IRQ_CLOCK BIT(0) /* Per-CRTC IRQ and clock */ 31 28 #define RCAR_DU_FEATURE_VSP1_SOURCE BIT(1) /* Has inputs from VSP1 */ ··· 72 71 #define RCAR_DU_MAX_CRTCS 4 73 72 #define RCAR_DU_MAX_GROUPS DIV_ROUND_UP(RCAR_DU_MAX_CRTCS, 2) 74 73 #define RCAR_DU_MAX_VSPS 4 74 + #define RCAR_DU_MAX_LVDS 2 75 75 76 76 struct rcar_du_device { 77 77 struct device *dev; ··· 80 78 81 79 void __iomem *mmio; 82 80 83 - struct drm_device *ddev; 81 + struct drm_device ddev; 84 82 85 83 struct rcar_du_crtc crtcs[RCAR_DU_MAX_CRTCS]; 86 84 unsigned int num_crtcs; 87 85 88 - struct rcar_du_encoder *encoders[RCAR_DU_OUTPUT_MAX]; 89 - 90 86 struct rcar_du_group groups[RCAR_DU_MAX_GROUPS]; 91 87 struct platform_device *cmms[RCAR_DU_MAX_CRTCS]; 92 88 struct rcar_du_vsp vsps[RCAR_DU_MAX_VSPS]; 89 + struct drm_bridge *lvds[RCAR_DU_MAX_LVDS]; 93 90 94 91 struct { 95 92 struct drm_property *colorkey; ··· 98 97 unsigned int dpad1_source; 99 98 unsigned int vspd1_sink; 100 99 }; 100 + 101 + static inline struct rcar_du_device *to_rcar_du_device(struct drm_device *dev) 102 + { 103 + return container_of(dev, struct rcar_du_device, ddev); 104 + } 101 105 102 106 static inline bool rcar_du_has(struct rcar_du_device *rcdu, 103 107 unsigned int feature)
+49 -49
drivers/gpu/drm/rcar-du/rcar_du_encoder.c
··· 8 8 */ 9 9 10 10 #include <linux/export.h> 11 + #include <linux/slab.h> 11 12 12 13 #include <drm/drm_bridge.h> 13 14 #include <drm/drm_crtc.h> 15 + #include <drm/drm_managed.h> 14 16 #include <drm/drm_modeset_helper_vtables.h> 15 17 #include <drm/drm_panel.h> 16 - #include <drm/drm_simple_kms_helper.h> 17 18 18 19 #include "rcar_du_drv.h" 19 20 #include "rcar_du_encoder.h" ··· 45 44 return num_ports; 46 45 } 47 46 47 + static const struct drm_encoder_funcs rcar_du_encoder_funcs = { 48 + }; 49 + 50 + static void rcar_du_encoder_release(struct drm_device *dev, void *res) 51 + { 52 + struct rcar_du_encoder *renc = res; 53 + 54 + drm_encoder_cleanup(&renc->base); 55 + kfree(renc); 56 + } 57 + 48 58 int rcar_du_encoder_init(struct rcar_du_device *rcdu, 49 59 enum rcar_du_output output, 50 60 struct device_node *enc_node) 51 61 { 52 62 struct rcar_du_encoder *renc; 53 - struct drm_encoder *encoder; 54 63 struct drm_bridge *bridge; 55 64 int ret; 56 - 57 - renc = devm_kzalloc(rcdu->dev, sizeof(*renc), GFP_KERNEL); 58 - if (renc == NULL) 59 - return -ENOMEM; 60 - 61 - rcdu->encoders[output] = renc; 62 - renc->output = output; 63 - encoder = rcar_encoder_to_drm_encoder(renc); 64 - 65 - dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n", 66 - enc_node, output); 67 65 68 66 /* 69 67 * Locate the DRM bridge from the DT node. For the DPAD outputs, if the ··· 74 74 rcar_du_encoder_count_ports(enc_node) == 1) { 75 75 struct drm_panel *panel = of_drm_find_panel(enc_node); 76 76 77 - if (IS_ERR(panel)) { 78 - ret = PTR_ERR(panel); 79 - goto done; 80 - } 77 + if (IS_ERR(panel)) 78 + return PTR_ERR(panel); 81 79 82 80 bridge = devm_drm_panel_bridge_add_typed(rcdu->dev, panel, 83 81 DRM_MODE_CONNECTOR_DPI); 84 - if (IS_ERR(bridge)) { 85 - ret = PTR_ERR(bridge); 86 - goto done; 87 - } 82 + if (IS_ERR(bridge)) 83 + return PTR_ERR(bridge); 88 84 } else { 89 85 bridge = of_drm_find_bridge(enc_node); 90 - if (!bridge) { 91 - ret = -EPROBE_DEFER; 92 - goto done; 93 - } 86 + if (!bridge) 87 + return -EPROBE_DEFER; 88 + 89 + if (output == RCAR_DU_OUTPUT_LVDS0 || 90 + output == RCAR_DU_OUTPUT_LVDS1) 91 + rcdu->lvds[output - RCAR_DU_OUTPUT_LVDS0] = bridge; 94 92 } 95 93 96 94 /* 97 - * On Gen3 skip the LVDS1 output if the LVDS1 encoder is used as a 98 - * companion for LVDS0 in dual-link mode. 95 + * Create and initialize the encoder. On Gen3 skip the LVDS1 output if 96 + * the LVDS1 encoder is used as a companion for LVDS0 in dual-link 97 + * mode. 99 98 */ 100 99 if (rcdu->info->gen >= 3 && output == RCAR_DU_OUTPUT_LVDS1) { 101 - if (rcar_lvds_dual_link(bridge)) { 102 - ret = -ENOLINK; 103 - goto done; 104 - } 100 + if (rcar_lvds_dual_link(bridge)) 101 + return -ENOLINK; 105 102 } 106 103 107 - ret = drm_simple_encoder_init(rcdu->ddev, encoder, 108 - DRM_MODE_ENCODER_NONE); 109 - if (ret < 0) 110 - goto done; 104 + renc = kzalloc(sizeof(*renc), GFP_KERNEL); 105 + if (renc == NULL) 106 + return -ENOMEM; 107 + 108 + renc->output = output; 109 + 110 + dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n", 111 + enc_node, output); 112 + 113 + ret = drm_encoder_init(&rcdu->ddev, &renc->base, &rcar_du_encoder_funcs, 114 + DRM_MODE_ENCODER_NONE, NULL); 115 + if (ret < 0) { 116 + kfree(renc); 117 + return ret; 118 + } 119 + 120 + ret = drmm_add_action_or_reset(&rcdu->ddev, rcar_du_encoder_release, 121 + renc); 122 + if (ret) 123 + return ret; 111 124 112 125 /* 113 126 * Attach the bridge to the encoder. The bridge will create the 114 127 * connector. 115 128 */ 116 - ret = drm_bridge_attach(encoder, bridge, NULL, 0); 117 - if (ret) { 118 - drm_encoder_cleanup(encoder); 119 - return ret; 120 - } 121 - 122 - done: 123 - if (ret < 0) { 124 - if (encoder->name) 125 - encoder->funcs->destroy(encoder); 126 - devm_kfree(rcdu->dev, renc); 127 - } 128 - 129 - return ret; 129 + return drm_bridge_attach(&renc->base, bridge, NULL, 0); 130 130 }
-2
drivers/gpu/drm/rcar-du/rcar_du_encoder.h
··· 22 22 #define to_rcar_encoder(e) \ 23 23 container_of(e, struct rcar_du_encoder, base) 24 24 25 - #define rcar_encoder_to_drm_encoder(e) (&(e)->base) 26 - 27 25 int rcar_du_encoder_init(struct rcar_du_device *rcdu, 28 26 enum rcar_du_output output, 29 27 struct device_node *enc_node);
+29 -13
drivers/gpu/drm/rcar-du/rcar_du_kms.c
··· 14 14 #include <drm/drm_fb_cma_helper.h> 15 15 #include <drm/drm_gem_cma_helper.h> 16 16 #include <drm/drm_gem_framebuffer_helper.h> 17 + #include <drm/drm_managed.h> 17 18 #include <drm/drm_probe_helper.h> 18 19 #include <drm/drm_vblank.h> 19 20 ··· 328 327 int rcar_du_dumb_create(struct drm_file *file, struct drm_device *dev, 329 328 struct drm_mode_create_dumb *args) 330 329 { 331 - struct rcar_du_device *rcdu = dev->dev_private; 330 + struct rcar_du_device *rcdu = to_rcar_du_device(dev); 332 331 unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8); 333 332 unsigned int align; 334 333 ··· 350 349 rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv, 351 350 const struct drm_mode_fb_cmd2 *mode_cmd) 352 351 { 353 - struct rcar_du_device *rcdu = dev->dev_private; 352 + struct rcar_du_device *rcdu = to_rcar_du_device(dev); 354 353 const struct rcar_du_format_info *format; 355 354 unsigned int chroma_pitch; 356 355 unsigned int max_pitch; ··· 422 421 static int rcar_du_atomic_check(struct drm_device *dev, 423 422 struct drm_atomic_state *state) 424 423 { 425 - struct rcar_du_device *rcdu = dev->dev_private; 424 + struct rcar_du_device *rcdu = to_rcar_du_device(dev); 426 425 int ret; 427 426 428 427 ret = drm_atomic_helper_check(dev, state); ··· 438 437 static void rcar_du_atomic_commit_tail(struct drm_atomic_state *old_state) 439 438 { 440 439 struct drm_device *dev = old_state->dev; 441 - struct rcar_du_device *rcdu = dev->dev_private; 440 + struct rcar_du_device *rcdu = to_rcar_du_device(dev); 442 441 struct drm_crtc_state *crtc_state; 443 442 struct drm_crtc *crtc; 444 443 unsigned int i; ··· 584 583 * or enable source color keying (1). 585 584 */ 586 585 rcdu->props.colorkey = 587 - drm_property_create_range(rcdu->ddev, 0, "colorkey", 586 + drm_property_create_range(&rcdu->ddev, 0, "colorkey", 588 587 0, 0x01ffffff); 589 588 if (rcdu->props.colorkey == NULL) 590 589 return -ENOMEM; ··· 701 700 int ret; 702 701 703 702 cmm = of_parse_phandle(np, "renesas,cmms", i); 704 - if (IS_ERR(cmm)) { 703 + if (!cmm) { 705 704 dev_err(rcdu->dev, 706 705 "Failed to parse 'renesas,cmms' property\n"); 707 - return PTR_ERR(cmm); 706 + return -EINVAL; 708 707 } 709 708 710 709 if (!of_device_is_available(cmm)) { ··· 714 713 } 715 714 716 715 pdev = of_find_device_by_node(cmm); 717 - if (IS_ERR(pdev)) { 716 + if (!pdev) { 718 717 dev_err(rcdu->dev, "No device found for CMM%u\n", i); 719 718 of_node_put(cmm); 720 - return PTR_ERR(pdev); 719 + return -EINVAL; 721 720 } 722 721 723 722 of_node_put(cmm); ··· 727 726 * disabled: return 0 and let the DU continue probing. 728 727 */ 729 728 ret = rcar_cmm_init(pdev); 730 - if (ret) 729 + if (ret) { 730 + platform_device_put(pdev); 731 731 return ret == -ENODEV ? 0 : ret; 732 + } 733 + 734 + rcdu->cmms[i] = pdev; 732 735 733 736 /* 734 737 * Enforce suspend/resume ordering by making the CMM a provider ··· 744 739 "Failed to create device link to CMM%u\n", i); 745 740 return -EINVAL; 746 741 } 747 - 748 - rcdu->cmms[i] = pdev; 749 742 } 750 743 751 744 return 0; 745 + } 746 + 747 + static void rcar_du_modeset_cleanup(struct drm_device *dev, void *res) 748 + { 749 + struct rcar_du_device *rcdu = to_rcar_du_device(dev); 750 + unsigned int i; 751 + 752 + for (i = 0; i < ARRAY_SIZE(rcdu->cmms); ++i) 753 + platform_device_put(rcdu->cmms[i]); 752 754 } 753 755 754 756 int rcar_du_modeset_init(struct rcar_du_device *rcdu) ··· 764 752 DU0_REG_OFFSET, DU2_REG_OFFSET 765 753 }; 766 754 767 - struct drm_device *dev = rcdu->ddev; 755 + struct drm_device *dev = &rcdu->ddev; 768 756 struct drm_encoder *encoder; 769 757 unsigned int dpad0_sources; 770 758 unsigned int num_encoders; ··· 775 763 int ret; 776 764 777 765 ret = drmm_mode_config_init(dev); 766 + if (ret) 767 + return ret; 768 + 769 + ret = drmm_add_action(&rcdu->ddev, rcar_du_modeset_cleanup, NULL); 778 770 if (ret) 779 771 return ret; 780 772
+4 -4
drivers/gpu/drm/rcar-du/rcar_du_plane.c
··· 128 128 int rcar_du_atomic_check_planes(struct drm_device *dev, 129 129 struct drm_atomic_state *state) 130 130 { 131 - struct rcar_du_device *rcdu = dev->dev_private; 131 + struct rcar_du_device *rcdu = to_rcar_du_device(dev); 132 132 unsigned int group_freed_planes[RCAR_DU_MAX_GROUPS] = { 0, }; 133 133 unsigned int group_free_planes[RCAR_DU_MAX_GROUPS] = { 0, }; 134 134 bool needs_realloc = false; ··· 773 773 774 774 plane->group = rgrp; 775 775 776 - ret = drm_universal_plane_init(rcdu->ddev, &plane->plane, crtcs, 777 - &rcar_du_plane_funcs, formats, 778 - ARRAY_SIZE(formats), 776 + ret = drm_universal_plane_init(&rcdu->ddev, &plane->plane, 777 + crtcs, &rcar_du_plane_funcs, 778 + formats, ARRAY_SIZE(formats), 779 779 NULL, type, NULL); 780 780 if (ret < 0) 781 781 return ret;
+20 -8
drivers/gpu/drm/rcar-du/rcar_du_vsp.c
··· 21 21 #include <linux/dma-mapping.h> 22 22 #include <linux/of_platform.h> 23 23 #include <linux/scatterlist.h> 24 + #include <linux/slab.h> 24 25 #include <linux/videodev2.h> 25 26 26 27 #include <media/vsp1.h> ··· 345 344 static void rcar_du_vsp_cleanup(struct drm_device *dev, void *res) 346 345 { 347 346 struct rcar_du_vsp *vsp = res; 347 + unsigned int i; 348 + 349 + for (i = 0; i < vsp->num_planes; ++i) { 350 + struct rcar_du_vsp_plane *plane = &vsp->planes[i]; 351 + 352 + drm_plane_cleanup(&plane->plane); 353 + } 354 + 355 + kfree(vsp->planes); 348 356 349 357 put_device(vsp->vsp); 350 358 } ··· 364 354 struct rcar_du_device *rcdu = vsp->dev; 365 355 struct platform_device *pdev; 366 356 unsigned int num_crtcs = hweight32(crtcs); 357 + unsigned int num_planes; 367 358 unsigned int i; 368 359 int ret; 369 360 ··· 375 364 376 365 vsp->vsp = &pdev->dev; 377 366 378 - ret = drmm_add_action(rcdu->ddev, rcar_du_vsp_cleanup, vsp); 367 + ret = drmm_add_action_or_reset(&rcdu->ddev, rcar_du_vsp_cleanup, vsp); 379 368 if (ret < 0) 380 369 return ret; 381 370 ··· 387 376 * The VSP2D (Gen3) has 5 RPFs, but the VSP1D (Gen2) is limited to 388 377 * 4 RPFs. 389 378 */ 390 - vsp->num_planes = rcdu->info->gen >= 3 ? 5 : 4; 379 + num_planes = rcdu->info->gen >= 3 ? 5 : 4; 391 380 392 - vsp->planes = devm_kcalloc(rcdu->dev, vsp->num_planes, 393 - sizeof(*vsp->planes), GFP_KERNEL); 381 + vsp->planes = kcalloc(num_planes, sizeof(*vsp->planes), GFP_KERNEL); 394 382 if (!vsp->planes) 395 383 return -ENOMEM; 396 384 397 - for (i = 0; i < vsp->num_planes; ++i) { 385 + for (i = 0; i < num_planes; ++i) { 398 386 enum drm_plane_type type = i < num_crtcs 399 387 ? DRM_PLANE_TYPE_PRIMARY 400 388 : DRM_PLANE_TYPE_OVERLAY; ··· 402 392 plane->vsp = vsp; 403 393 plane->index = i; 404 394 405 - ret = drm_universal_plane_init(rcdu->ddev, &plane->plane, crtcs, 406 - &rcar_du_vsp_plane_funcs, 395 + ret = drm_universal_plane_init(&rcdu->ddev, &plane->plane, 396 + crtcs, &rcar_du_vsp_plane_funcs, 407 397 rcar_du_vsp_formats, 408 398 ARRAY_SIZE(rcar_du_vsp_formats), 409 399 NULL, type, NULL); ··· 419 409 } else { 420 410 drm_plane_create_alpha_property(&plane->plane); 421 411 drm_plane_create_zpos_property(&plane->plane, 1, 1, 422 - vsp->num_planes - 1); 412 + num_planes - 1); 423 413 } 414 + 415 + vsp->num_planes++; 424 416 } 425 417 426 418 return 0;
+1 -1
drivers/gpu/drm/rcar-du/rcar_du_writeback.c
··· 204 204 drm_connector_helper_add(&wb_conn->base, 205 205 &rcar_du_wb_conn_helper_funcs); 206 206 207 - return drm_writeback_connector_init(rcdu->ddev, wb_conn, 207 + return drm_writeback_connector_init(&rcdu->ddev, wb_conn, 208 208 &rcar_du_wb_conn_funcs, 209 209 &rcar_du_wb_enc_helper_funcs, 210 210 writeback_formats,
+1 -8
drivers/gpu/drm/sti/sti_cursor.c
··· 330 330 .atomic_disable = sti_cursor_atomic_disable, 331 331 }; 332 332 333 - static void sti_cursor_destroy(struct drm_plane *drm_plane) 334 - { 335 - DRM_DEBUG_DRIVER("\n"); 336 - 337 - drm_plane_cleanup(drm_plane); 338 - } 339 - 340 333 static int sti_cursor_late_register(struct drm_plane *drm_plane) 341 334 { 342 335 struct sti_plane *plane = to_sti_plane(drm_plane); ··· 343 350 static const struct drm_plane_funcs sti_cursor_plane_helpers_funcs = { 344 351 .update_plane = drm_atomic_helper_update_plane, 345 352 .disable_plane = drm_atomic_helper_disable_plane, 346 - .destroy = sti_cursor_destroy, 353 + .destroy = drm_plane_cleanup, 347 354 .reset = sti_plane_reset, 348 355 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, 349 356 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
+1 -8
drivers/gpu/drm/sti/sti_gdp.c
··· 884 884 .atomic_disable = sti_gdp_atomic_disable, 885 885 }; 886 886 887 - static void sti_gdp_destroy(struct drm_plane *drm_plane) 888 - { 889 - DRM_DEBUG_DRIVER("\n"); 890 - 891 - drm_plane_cleanup(drm_plane); 892 - } 893 - 894 887 static int sti_gdp_late_register(struct drm_plane *drm_plane) 895 888 { 896 889 struct sti_plane *plane = to_sti_plane(drm_plane); ··· 895 902 static const struct drm_plane_funcs sti_gdp_plane_helpers_funcs = { 896 903 .update_plane = drm_atomic_helper_update_plane, 897 904 .disable_plane = drm_atomic_helper_disable_plane, 898 - .destroy = sti_gdp_destroy, 905 + .destroy = drm_plane_cleanup, 899 906 .reset = sti_plane_reset, 900 907 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, 901 908 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
+1 -8
drivers/gpu/drm/sti/sti_hqvdp.c
··· 1262 1262 .atomic_disable = sti_hqvdp_atomic_disable, 1263 1263 }; 1264 1264 1265 - static void sti_hqvdp_destroy(struct drm_plane *drm_plane) 1266 - { 1267 - DRM_DEBUG_DRIVER("\n"); 1268 - 1269 - drm_plane_cleanup(drm_plane); 1270 - } 1271 - 1272 1265 static int sti_hqvdp_late_register(struct drm_plane *drm_plane) 1273 1266 { 1274 1267 struct sti_plane *plane = to_sti_plane(drm_plane); ··· 1275 1282 static const struct drm_plane_funcs sti_hqvdp_plane_helpers_funcs = { 1276 1283 .update_plane = drm_atomic_helper_update_plane, 1277 1284 .disable_plane = drm_atomic_helper_disable_plane, 1278 - .destroy = sti_hqvdp_destroy, 1285 + .destroy = drm_plane_cleanup, 1279 1286 .reset = sti_plane_reset, 1280 1287 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, 1281 1288 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
+1 -1
drivers/gpu/drm/tdfx/tdfx_drv.c
··· 56 56 .llseek = noop_llseek, 57 57 }; 58 58 59 - static struct drm_driver driver = { 59 + static const struct drm_driver driver = { 60 60 .driver_features = DRIVER_LEGACY, 61 61 .fops = &tdfx_driver_fops, 62 62 .name = DRIVER_NAME,
+1 -6
drivers/gpu/drm/vc4/vc4_plane.c
··· 1268 1268 .atomic_async_update = vc4_plane_atomic_async_update, 1269 1269 }; 1270 1270 1271 - static void vc4_plane_destroy(struct drm_plane *plane) 1272 - { 1273 - drm_plane_cleanup(plane); 1274 - } 1275 - 1276 1271 static bool vc4_format_mod_supported(struct drm_plane *plane, 1277 1272 uint32_t format, 1278 1273 uint64_t modifier) ··· 1318 1323 static const struct drm_plane_funcs vc4_plane_funcs = { 1319 1324 .update_plane = drm_atomic_helper_update_plane, 1320 1325 .disable_plane = drm_atomic_helper_disable_plane, 1321 - .destroy = vc4_plane_destroy, 1326 + .destroy = drm_plane_cleanup, 1322 1327 .set_property = NULL, 1323 1328 .reset = vc4_plane_reset, 1324 1329 .atomic_duplicate_state = vc4_plane_duplicate_state,
+1 -6
drivers/gpu/drm/zte/zx_plane.c
··· 438 438 .atomic_disable = zx_plane_atomic_disable, 439 439 }; 440 440 441 - static void zx_plane_destroy(struct drm_plane *plane) 442 - { 443 - drm_plane_cleanup(plane); 444 - } 445 - 446 441 static const struct drm_plane_funcs zx_plane_funcs = { 447 442 .update_plane = drm_atomic_helper_update_plane, 448 443 .disable_plane = drm_atomic_helper_disable_plane, 449 - .destroy = zx_plane_destroy, 444 + .destroy = drm_plane_cleanup, 450 445 .reset = drm_atomic_helper_plane_reset, 451 446 .atomic_duplicate_state = drm_atomic_helper_plane_duplicate_state, 452 447 .atomic_destroy_state = drm_atomic_helper_plane_destroy_state,
+3 -11
include/drm/drm_device.h
··· 51 51 * may contain multiple heads. 52 52 */ 53 53 struct drm_device { 54 - /** 55 - * @legacy_dev_list: 56 - * 57 - * List of devices per driver for stealth attach cleanup 58 - */ 59 - struct list_head legacy_dev_list; 60 - 61 54 /** @if_version: Highest interface version set */ 62 55 int if_version; 63 56 ··· 76 83 } managed; 77 84 78 85 /** @driver: DRM driver managing the device */ 79 - #ifdef CONFIG_DRM_LEGACY 80 - struct drm_driver *driver; 81 - #else 82 86 const struct drm_driver *driver; 83 - #endif 84 87 85 88 /** 86 89 * @dev_private: ··· 325 336 /* Everything below here is for legacy driver, never use! */ 326 337 /* private: */ 327 338 #if IS_ENABLED(CONFIG_DRM_LEGACY) 339 + /* List of devices per driver for stealth attach cleanup */ 340 + struct list_head legacy_dev_list; 341 + 328 342 /* Context handle management - linked list of context handles */ 329 343 struct list_head ctxlist; 330 344
-2
include/drm/drm_drv.h
··· 499 499 /* Everything below here is for legacy driver, never use! */ 500 500 /* private: */ 501 501 502 - /* List of devices hanging off this driver with stealth attach. */ 503 - struct list_head legacy_dev_list; 504 502 int (*firstopen) (struct drm_device *); 505 503 void (*preclose) (struct drm_device *, struct drm_file *file_priv); 506 504 int (*dma_ioctl) (struct drm_device *dev, void *data, struct drm_file *file_priv);
-3
include/drm/drm_gem.h
··· 416 416 bool write); 417 417 int drm_gem_dumb_map_offset(struct drm_file *file, struct drm_device *dev, 418 418 u32 handle, u64 *offset); 419 - int drm_gem_dumb_destroy(struct drm_file *file, 420 - struct drm_device *dev, 421 - uint32_t handle); 422 419 423 420 #endif /* __DRM_GEM_H__ */
+6 -4
include/drm/drm_legacy.h
··· 198 198 size_t align); 199 199 void drm_pci_free(struct drm_device *dev, struct drm_dma_handle *dmah); 200 200 201 - int drm_legacy_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); 202 - void drm_legacy_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); 201 + int drm_legacy_pci_init(const struct drm_driver *driver, 202 + struct pci_driver *pdriver); 203 + void drm_legacy_pci_exit(const struct drm_driver *driver, 204 + struct pci_driver *pdriver); 203 205 204 206 #else 205 207 ··· 216 214 { 217 215 } 218 216 219 - static inline int drm_legacy_pci_init(struct drm_driver *driver, 217 + static inline int drm_legacy_pci_init(const struct drm_driver *driver, 220 218 struct pci_driver *pdriver) 221 219 { 222 220 return -EINVAL; 223 221 } 224 222 225 - static inline void drm_legacy_pci_exit(struct drm_driver *driver, 223 + static inline void drm_legacy_pci_exit(const struct drm_driver *driver, 226 224 struct pci_driver *pdriver) 227 225 { 228 226 }
+7 -1
include/drm/drm_modeset_helper_vtables.h
··· 866 866 * The usual way to implement this is to cache the EDID retrieved in the 867 867 * probe callback somewhere in the driver-private connector structure. 868 868 * In this function drivers then parse the modes in the EDID and add 869 - * them by calling drm_add_edid_modes(). But connectors that driver a 869 + * them by calling drm_add_edid_modes(). But connectors that drive a 870 870 * fixed panel can also manually add specific modes using 871 871 * drm_mode_probed_add(). Drivers which manually add modes should also 872 872 * make sure that the &drm_connector.display_info, 873 873 * &drm_connector.width_mm and &drm_connector.height_mm fields are 874 874 * filled in. 875 + * 876 + * Note that the caller function will automatically add standard VESA 877 + * DMT modes up to 1024x768 if the .get_modes() helper operation returns 878 + * no mode and if the connector status is connector_status_connected or 879 + * connector_status_unknown. There is no need to call 880 + * drm_add_modes_noedid() manually in that case. 875 881 * 876 882 * Virtual drivers that just want some standard VESA mode with a given 877 883 * resolution can call drm_add_modes_noedid(), and mark the preferred