diff options
| author | Dave Airlie <airlied@redhat.com> | 2017-01-31 17:31:09 -0500 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2017-01-31 17:31:09 -0500 |
| commit | 012bbe28c0e3a479ec7ba6f311710cf8409647d4 (patch) | |
| tree | 9cfe299e0cfa72a078faa73d5c0a9263d2ebe8a2 /drivers/gpu | |
| parent | bb7e98334157de206d7b1283377fdb4ea9e2e8c6 (diff) | |
| parent | 55d6616585363ff2aa9430bfe1ff1345bdc0599a (diff) | |
Merge tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc into drm-next
Another round of -misc stuff:
- Noralf debugfs cleanup cleanup (not yet everything, some more driver
patches awaiting acks).
- More doc work.
- edid/infoframe fixes from Ville.
- misc 1-patch fixes all over, as usual
Noralf needs this for his tinydrm pull request.
* tag 'drm-misc-next-2017-01-30' of git://anongit.freedesktop.org/git/drm-misc: (48 commits)
drm/vc4: Remove vc4_debugfs_cleanup()
dma/fence: Export enable-signaling tracepoint for emission by drivers
drm/tilcdc: Remove tilcdc_debugfs_cleanup()
drm/tegra: Remove tegra_debugfs_cleanup()
drm/sti: Remove drm_debugfs_remove_files() calls
drm/radeon: Remove drm_debugfs_remove_files() call
drm/omap: Remove omap_debugfs_cleanup()
drm/hdlcd: Remove hdlcd_debugfs_cleanup()
drm/etnaviv: Remove etnaviv_debugfs_cleanup()
drm/etnaviv: allow build with COMPILE_TEST
drm/amd/amdgpu: Remove drm_debugfs_remove_files() call
drm/prime: Clarify DMA-BUF/GEM Object lifetime
drm/ttm: Make sure BOs being swapped out are cacheable
drm/atomic: Remove drm_atomic_debugfs_cleanup()
drm: drm_minor_register(): Clean up debugfs on failure
drm: debugfs: Remove all files automatically on cleanup
drm/fourcc: add vivante tiled layout format modifiers
drm/edid: Set YQ bits in the AVI infoframe according to CEA-861-F
drm/edid: Set AVI infoframe Q even when QS=0
drm/edid: Introduce drm_hdmi_avi_infoframe_quant_range()
...
Diffstat (limited to 'drivers/gpu')
79 files changed, 464 insertions, 566 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index f4f371fbce16..73863d465f98 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h | |||
| @@ -1133,7 +1133,6 @@ int amdgpu_debugfs_fence_init(struct amdgpu_device *adev); | |||
| 1133 | 1133 | ||
| 1134 | #if defined(CONFIG_DEBUG_FS) | 1134 | #if defined(CONFIG_DEBUG_FS) |
| 1135 | int amdgpu_debugfs_init(struct drm_minor *minor); | 1135 | int amdgpu_debugfs_init(struct drm_minor *minor); |
| 1136 | void amdgpu_debugfs_cleanup(struct drm_minor *minor); | ||
| 1137 | #endif | 1136 | #endif |
| 1138 | 1137 | ||
| 1139 | int amdgpu_debugfs_firmware_init(struct amdgpu_device *adev); | 1138 | int amdgpu_debugfs_firmware_init(struct amdgpu_device *adev); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index fe3bb94fe58d..2201303b9262 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
| @@ -1852,8 +1852,6 @@ failed: | |||
| 1852 | return r; | 1852 | return r; |
| 1853 | } | 1853 | } |
| 1854 | 1854 | ||
| 1855 | static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev); | ||
| 1856 | |||
| 1857 | /** | 1855 | /** |
| 1858 | * amdgpu_device_fini - tear down the driver | 1856 | * amdgpu_device_fini - tear down the driver |
| 1859 | * | 1857 | * |
| @@ -1893,7 +1891,6 @@ void amdgpu_device_fini(struct amdgpu_device *adev) | |||
| 1893 | if (adev->asic_type >= CHIP_BONAIRE) | 1891 | if (adev->asic_type >= CHIP_BONAIRE) |
| 1894 | amdgpu_doorbell_fini(adev); | 1892 | amdgpu_doorbell_fini(adev); |
| 1895 | amdgpu_debugfs_regs_cleanup(adev); | 1893 | amdgpu_debugfs_regs_cleanup(adev); |
| 1896 | amdgpu_debugfs_remove_files(adev); | ||
| 1897 | } | 1894 | } |
| 1898 | 1895 | ||
| 1899 | 1896 | ||
| @@ -2507,19 +2504,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev, | |||
| 2507 | return 0; | 2504 | return 0; |
| 2508 | } | 2505 | } |
| 2509 | 2506 | ||
| 2510 | static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev) | ||
| 2511 | { | ||
| 2512 | #if defined(CONFIG_DEBUG_FS) | ||
| 2513 | unsigned i; | ||
| 2514 | |||
| 2515 | for (i = 0; i < adev->debugfs_count; i++) { | ||
| 2516 | drm_debugfs_remove_files(adev->debugfs[i].files, | ||
| 2517 | adev->debugfs[i].num_files, | ||
| 2518 | adev->ddev->primary); | ||
| 2519 | } | ||
| 2520 | #endif | ||
| 2521 | } | ||
| 2522 | |||
| 2523 | #if defined(CONFIG_DEBUG_FS) | 2507 | #if defined(CONFIG_DEBUG_FS) |
| 2524 | 2508 | ||
| 2525 | static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf, | 2509 | static ssize_t amdgpu_debugfs_regs_read(struct file *f, char __user *buf, |
| @@ -3153,10 +3137,6 @@ int amdgpu_debugfs_init(struct drm_minor *minor) | |||
| 3153 | { | 3137 | { |
| 3154 | return 0; | 3138 | return 0; |
| 3155 | } | 3139 | } |
| 3156 | |||
| 3157 | void amdgpu_debugfs_cleanup(struct drm_minor *minor) | ||
| 3158 | { | ||
| 3159 | } | ||
| 3160 | #else | 3140 | #else |
| 3161 | static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev) | 3141 | static int amdgpu_debugfs_regs_init(struct amdgpu_device *adev) |
| 3162 | { | 3142 | { |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 2534adaebe30..ba2816b3cd07 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
| @@ -686,7 +686,6 @@ static struct drm_driver kms_driver = { | |||
| 686 | DRIVER_USE_AGP | | 686 | DRIVER_USE_AGP | |
| 687 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | | 687 | DRIVER_HAVE_IRQ | DRIVER_IRQ_SHARED | DRIVER_GEM | |
| 688 | DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET, | 688 | DRIVER_PRIME | DRIVER_RENDER | DRIVER_MODESET, |
| 689 | .dev_priv_size = 0, | ||
| 690 | .load = amdgpu_driver_load_kms, | 689 | .load = amdgpu_driver_load_kms, |
| 691 | .open = amdgpu_driver_open_kms, | 690 | .open = amdgpu_driver_open_kms, |
| 692 | .preclose = amdgpu_driver_preclose_kms, | 691 | .preclose = amdgpu_driver_preclose_kms, |
| @@ -701,7 +700,6 @@ static struct drm_driver kms_driver = { | |||
| 701 | .get_scanout_position = amdgpu_get_crtc_scanoutpos, | 700 | .get_scanout_position = amdgpu_get_crtc_scanoutpos, |
| 702 | #if defined(CONFIG_DEBUG_FS) | 701 | #if defined(CONFIG_DEBUG_FS) |
| 703 | .debugfs_init = amdgpu_debugfs_init, | 702 | .debugfs_init = amdgpu_debugfs_init, |
| 704 | .debugfs_cleanup = amdgpu_debugfs_cleanup, | ||
| 705 | #endif | 703 | #endif |
| 706 | .irq_preinstall = amdgpu_irq_preinstall, | 704 | .irq_preinstall = amdgpu_irq_preinstall, |
| 707 | .irq_postinstall = amdgpu_irq_postinstall, | 705 | .irq_postinstall = amdgpu_irq_postinstall, |
diff --git a/drivers/gpu/drm/arm/hdlcd_drv.c b/drivers/gpu/drm/arm/hdlcd_drv.c index e5f4f4a6546d..a2e5b04cdee3 100644 --- a/drivers/gpu/drm/arm/hdlcd_drv.c +++ b/drivers/gpu/drm/arm/hdlcd_drv.c | |||
| @@ -255,12 +255,6 @@ static int hdlcd_debugfs_init(struct drm_minor *minor) | |||
| 255 | return drm_debugfs_create_files(hdlcd_debugfs_list, | 255 | return drm_debugfs_create_files(hdlcd_debugfs_list, |
| 256 | ARRAY_SIZE(hdlcd_debugfs_list), minor->debugfs_root, minor); | 256 | ARRAY_SIZE(hdlcd_debugfs_list), minor->debugfs_root, minor); |
| 257 | } | 257 | } |
| 258 | |||
| 259 | static void hdlcd_debugfs_cleanup(struct drm_minor *minor) | ||
| 260 | { | ||
| 261 | drm_debugfs_remove_files(hdlcd_debugfs_list, | ||
| 262 | ARRAY_SIZE(hdlcd_debugfs_list), minor); | ||
| 263 | } | ||
| 264 | #endif | 258 | #endif |
| 265 | 259 | ||
| 266 | static const struct file_operations fops = { | 260 | static const struct file_operations fops = { |
| @@ -303,7 +297,6 @@ static struct drm_driver hdlcd_driver = { | |||
| 303 | .gem_prime_mmap = drm_gem_cma_prime_mmap, | 297 | .gem_prime_mmap = drm_gem_cma_prime_mmap, |
| 304 | #ifdef CONFIG_DEBUG_FS | 298 | #ifdef CONFIG_DEBUG_FS |
| 305 | .debugfs_init = hdlcd_debugfs_init, | 299 | .debugfs_init = hdlcd_debugfs_init, |
| 306 | .debugfs_cleanup = hdlcd_debugfs_cleanup, | ||
| 307 | #endif | 300 | #endif |
| 308 | .fops = &fops, | 301 | .fops = &fops, |
| 309 | .name = "hdlcd", | 302 | .name = "hdlcd", |
diff --git a/drivers/gpu/drm/bridge/dw-hdmi.c b/drivers/gpu/drm/bridge/dw-hdmi.c index 4fda0717e789..9a9ec27d9e28 100644 --- a/drivers/gpu/drm/bridge/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/dw-hdmi.c | |||
| @@ -2060,7 +2060,9 @@ __dw_hdmi_probe(struct platform_device *pdev, | |||
| 2060 | 2060 | ||
| 2061 | hdmi->bridge.driver_private = hdmi; | 2061 | hdmi->bridge.driver_private = hdmi; |
| 2062 | hdmi->bridge.funcs = &dw_hdmi_bridge_funcs; | 2062 | hdmi->bridge.funcs = &dw_hdmi_bridge_funcs; |
| 2063 | #ifdef CONFIG_OF | ||
| 2063 | hdmi->bridge.of_node = pdev->dev.of_node; | 2064 | hdmi->bridge.of_node = pdev->dev.of_node; |
| 2065 | #endif | ||
| 2064 | 2066 | ||
| 2065 | ret = dw_hdmi_fb_registered(hdmi); | 2067 | ret = dw_hdmi_fb_registered(hdmi); |
| 2066 | if (ret) | 2068 | if (ret) |
diff --git a/drivers/gpu/drm/drm_agpsupport.c b/drivers/gpu/drm/drm_agpsupport.c index d621c8a4cf00..c89953449e96 100644 --- a/drivers/gpu/drm/drm_agpsupport.c +++ b/drivers/gpu/drm/drm_agpsupport.c | |||
| @@ -421,6 +421,8 @@ struct drm_agp_head *drm_agp_init(struct drm_device *dev) | |||
| 421 | head->base = head->agp_info.aper_base; | 421 | head->base = head->agp_info.aper_base; |
| 422 | return head; | 422 | return head; |
| 423 | } | 423 | } |
| 424 | /* Only exported for i810.ko */ | ||
| 425 | EXPORT_SYMBOL(drm_agp_init); | ||
| 424 | 426 | ||
| 425 | /** | 427 | /** |
| 426 | * drm_legacy_agp_clear - Clear AGP resource list | 428 | * drm_legacy_agp_clear - Clear AGP resource list |
diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 6414bcf7f41b..e5b738660d66 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c | |||
| @@ -195,8 +195,8 @@ EXPORT_SYMBOL(drm_atomic_state_default_clear); | |||
| 195 | * all locks. So someone else could sneak in and change the current modeset | 195 | * all locks. So someone else could sneak in and change the current modeset |
| 196 | * configuration. Which means that all the state assembled in @state is no | 196 | * configuration. Which means that all the state assembled in @state is no |
| 197 | * longer an atomic update to the current state, but to some arbitrary earlier | 197 | * longer an atomic update to the current state, but to some arbitrary earlier |
| 198 | * state. Which could break assumptions the driver's ->atomic_check likely | 198 | * state. Which could break assumptions the driver's |
| 199 | * relies on. | 199 | * &drm_mode_config_funcs.atomic_check likely relies on. |
| 200 | * | 200 | * |
| 201 | * Hence we must clear all cached state and completely start over, using this | 201 | * Hence we must clear all cached state and completely start over, using this |
| 202 | * function. | 202 | * function. |
| @@ -456,11 +456,10 @@ drm_atomic_replace_property_blob_from_id(struct drm_crtc *crtc, | |||
| 456 | * @property: the property to set | 456 | * @property: the property to set |
| 457 | * @val: the new property value | 457 | * @val: the new property value |
| 458 | * | 458 | * |
| 459 | * Use this instead of calling crtc->atomic_set_property directly. | 459 | * This function handles generic/core properties and calls out to driver's |
| 460 | * This function handles generic/core properties and calls out to | 460 | * &drm_crtc_funcs.atomic_set_property for driver properties. To ensure |
| 461 | * driver's ->atomic_set_property() for driver properties. To ensure | 461 | * consistent behavior you must call this function rather than the driver hook |
| 462 | * consistent behavior you must call this function rather than the | 462 | * directly. |
| 463 | * driver hook directly. | ||
| 464 | * | 463 | * |
| 465 | * RETURNS: | 464 | * RETURNS: |
| 466 | * Zero on success, error code on failure | 465 | * Zero on success, error code on failure |
| @@ -532,10 +531,10 @@ EXPORT_SYMBOL(drm_atomic_crtc_set_property); | |||
| 532 | * @property: the property to set | 531 | * @property: the property to set |
| 533 | * @val: return location for the property value | 532 | * @val: return location for the property value |
| 534 | * | 533 | * |
| 535 | * This function handles generic/core properties and calls out to | 534 | * This function handles generic/core properties and calls out to driver's |
| 536 | * driver's ->atomic_get_property() for driver properties. To ensure | 535 | * &drm_crtc_funcs.atomic_get_property for driver properties. To ensure |
| 537 | * consistent behavior you must call this function rather than the | 536 | * consistent behavior you must call this function rather than the driver hook |
| 538 | * driver hook directly. | 537 | * directly. |
| 539 | * | 538 | * |
| 540 | * RETURNS: | 539 | * RETURNS: |
| 541 | * Zero on success, error code on failure | 540 | * Zero on success, error code on failure |
| @@ -716,11 +715,10 @@ EXPORT_SYMBOL(drm_atomic_get_plane_state); | |||
| 716 | * @property: the property to set | 715 | * @property: the property to set |
| 717 | * @val: the new property value | 716 | * @val: the new property value |
| 718 | * | 717 | * |
| 719 | * Use this instead of calling plane->atomic_set_property directly. | 718 | * This function handles generic/core properties and calls out to driver's |
| 720 | * This function handles generic/core properties and calls out to | 719 | * &drm_plane_funcs.atomic_set_property for driver properties. To ensure |
| 721 | * driver's ->atomic_set_property() for driver properties. To ensure | 720 | * consistent behavior you must call this function rather than the driver hook |
| 722 | * consistent behavior you must call this function rather than the | 721 | * directly. |
| 723 | * driver hook directly. | ||
| 724 | * | 722 | * |
| 725 | * RETURNS: | 723 | * RETURNS: |
| 726 | * Zero on success, error code on failure | 724 | * Zero on success, error code on failure |
| @@ -791,10 +789,10 @@ EXPORT_SYMBOL(drm_atomic_plane_set_property); | |||
| 791 | * @property: the property to set | 789 | * @property: the property to set |
| 792 | * @val: return location for the property value | 790 | * @val: return location for the property value |
| 793 | * | 791 | * |
| 794 | * This function handles generic/core properties and calls out to | 792 | * This function handles generic/core properties and calls out to driver's |
| 795 | * driver's ->atomic_get_property() for driver properties. To ensure | 793 | * &drm_plane_funcs.atomic_get_property for driver properties. To ensure |
| 796 | * consistent behavior you must call this function rather than the | 794 | * consistent behavior you must call this function rather than the driver hook |
| 797 | * driver hook directly. | 795 | * directly. |
| 798 | * | 796 | * |
| 799 | * RETURNS: | 797 | * RETURNS: |
| 800 | * Zero on success, error code on failure | 798 | * Zero on success, error code on failure |
| @@ -1057,11 +1055,10 @@ EXPORT_SYMBOL(drm_atomic_get_connector_state); | |||
| 1057 | * @property: the property to set | 1055 | * @property: the property to set |
| 1058 | * @val: the new property value | 1056 | * @val: the new property value |
| 1059 | * | 1057 | * |
| 1060 | * Use this instead of calling connector->atomic_set_property directly. | 1058 | * This function handles generic/core properties and calls out to driver's |
| 1061 | * This function handles generic/core properties and calls out to | 1059 | * &drm_connector_funcs.atomic_set_property for driver properties. To ensure |
| 1062 | * driver's ->atomic_set_property() for driver properties. To ensure | 1060 | * consistent behavior you must call this function rather than the driver hook |
| 1063 | * consistent behavior you must call this function rather than the | 1061 | * directly. |
| 1064 | * driver hook directly. | ||
| 1065 | * | 1062 | * |
| 1066 | * RETURNS: | 1063 | * RETURNS: |
| 1067 | * Zero on success, error code on failure | 1064 | * Zero on success, error code on failure |
| @@ -1136,10 +1133,10 @@ static void drm_atomic_connector_print_state(struct drm_printer *p, | |||
| 1136 | * @property: the property to set | 1133 | * @property: the property to set |
| 1137 | * @val: return location for the property value | 1134 | * @val: return location for the property value |
| 1138 | * | 1135 | * |
| 1139 | * This function handles generic/core properties and calls out to | 1136 | * This function handles generic/core properties and calls out to driver's |
| 1140 | * driver's ->atomic_get_property() for driver properties. To ensure | 1137 | * &drm_connector_funcs.atomic_get_property for driver properties. To ensure |
| 1141 | * consistent behavior you must call this function rather than the | 1138 | * consistent behavior you must call this function rather than the driver hook |
| 1142 | * driver hook directly. | 1139 | * directly. |
| 1143 | * | 1140 | * |
| 1144 | * RETURNS: | 1141 | * RETURNS: |
| 1145 | * Zero on success, error code on failure | 1142 | * Zero on success, error code on failure |
| @@ -1312,12 +1309,11 @@ EXPORT_SYMBOL(drm_atomic_set_fb_for_plane); | |||
| 1312 | * implicit or explicit fencing. | 1309 | * implicit or explicit fencing. |
| 1313 | * | 1310 | * |
| 1314 | * This function will not set the fence to the state if it was set | 1311 | * This function will not set the fence to the state if it was set |
| 1315 | * via explicit fencing interfaces on the atomic ioctl. It will | 1312 | * via explicit fencing interfaces on the atomic ioctl. In that case it will |
| 1316 | * all drope the reference to the fence as we not storing it | 1313 | * drop the reference to the fence as we are not storing it anywhere. |
| 1317 | * anywhere. | 1314 | * Otherwise, if &drm_plane_state.fence is not set this function we just set it |
| 1318 | * | 1315 | * with the received implicit fence. In both cases this function consumes a |
| 1319 | * Otherwise, if plane_state->fence is not set this function we | 1316 | * reference for @fence. |
| 1320 | * just set it with the received implict fence. | ||
| 1321 | */ | 1317 | */ |
| 1322 | void | 1318 | void |
| 1323 | drm_atomic_set_fence_for_plane(struct drm_plane_state *plane_state, | 1319 | drm_atomic_set_fence_for_plane(struct drm_plane_state *plane_state, |
| @@ -1616,7 +1612,7 @@ int drm_atomic_commit(struct drm_atomic_state *state) | |||
| 1616 | EXPORT_SYMBOL(drm_atomic_commit); | 1612 | EXPORT_SYMBOL(drm_atomic_commit); |
| 1617 | 1613 | ||
| 1618 | /** | 1614 | /** |
| 1619 | * drm_atomic_nonblocking_commit - atomic&nonblocking configuration commit | 1615 | * drm_atomic_nonblocking_commit - atomic nonblocking commit |
| 1620 | * @state: atomic configuration to check | 1616 | * @state: atomic configuration to check |
| 1621 | * | 1617 | * |
| 1622 | * Note that this function can return -EDEADLK if the driver needed to acquire | 1618 | * Note that this function can return -EDEADLK if the driver needed to acquire |
| @@ -1731,13 +1727,6 @@ int drm_atomic_debugfs_init(struct drm_minor *minor) | |||
| 1731 | ARRAY_SIZE(drm_atomic_debugfs_list), | 1727 | ARRAY_SIZE(drm_atomic_debugfs_list), |
| 1732 | minor->debugfs_root, minor); | 1728 | minor->debugfs_root, minor); |
| 1733 | } | 1729 | } |
| 1734 | |||
| 1735 | int drm_atomic_debugfs_cleanup(struct drm_minor *minor) | ||
| 1736 | { | ||
| 1737 | return drm_debugfs_remove_files(drm_atomic_debugfs_list, | ||
| 1738 | ARRAY_SIZE(drm_atomic_debugfs_list), | ||
| 1739 | minor); | ||
| 1740 | } | ||
| 1741 | #endif | 1730 | #endif |
| 1742 | 1731 | ||
| 1743 | /* | 1732 | /* |
| @@ -1829,10 +1818,10 @@ static int atomic_set_prop(struct drm_atomic_state *state, | |||
| 1829 | * @plane_mask: plane mask for planes that were updated. | 1818 | * @plane_mask: plane mask for planes that were updated. |
| 1830 | * @ret: return value, can be -EDEADLK for a retry. | 1819 | * @ret: return value, can be -EDEADLK for a retry. |
| 1831 | * | 1820 | * |
| 1832 | * Before doing an update plane->old_fb is set to plane->fb, | 1821 | * Before doing an update &drm_plane.old_fb is set to &drm_plane.fb, but before |
| 1833 | * but before dropping the locks old_fb needs to be set to NULL | 1822 | * dropping the locks old_fb needs to be set to NULL and plane->fb updated. This |
| 1834 | * and plane->fb updated. This is a common operation for each | 1823 | * is a common operation for each atomic update, so this call is split off as a |
| 1835 | * atomic update, so this call is split off as a helper. | 1824 | * helper. |
| 1836 | */ | 1825 | */ |
| 1837 | void drm_atomic_clean_old_fb(struct drm_device *dev, | 1826 | void drm_atomic_clean_old_fb(struct drm_device *dev, |
| 1838 | unsigned plane_mask, | 1827 | unsigned plane_mask, |
| @@ -1873,7 +1862,7 @@ EXPORT_SYMBOL(drm_atomic_clean_old_fb); | |||
| 1873 | * As a contrast, with implicit fencing the kernel keeps track of any | 1862 | * As a contrast, with implicit fencing the kernel keeps track of any |
| 1874 | * ongoing rendering, and automatically ensures that the atomic update waits | 1863 | * ongoing rendering, and automatically ensures that the atomic update waits |
| 1875 | * for any pending rendering to complete. For shared buffers represented with | 1864 | * for any pending rendering to complete. For shared buffers represented with |
| 1876 | * a &struct dma_buf this is tracked in &reservation_object structures. | 1865 | * a &struct dma_buf this is tracked in &struct reservation_object. |
| 1877 | * Implicit syncing is how Linux traditionally worked (e.g. DRI2/3 on X.org), | 1866 | * Implicit syncing is how Linux traditionally worked (e.g. DRI2/3 on X.org), |
| 1878 | * whereas explicit fencing is what Android wants. | 1867 | * whereas explicit fencing is what Android wants. |
| 1879 | * | 1868 | * |
diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c index b26e3419027e..9a08445a7a7a 100644 --- a/drivers/gpu/drm/drm_atomic_helper.c +++ b/drivers/gpu/drm/drm_atomic_helper.c | |||
| @@ -458,22 +458,25 @@ mode_fixup(struct drm_atomic_state *state) | |||
| 458 | * Check the state object to see if the requested state is physically possible. | 458 | * Check the state object to see if the requested state is physically possible. |
| 459 | * This does all the crtc and connector related computations for an atomic | 459 | * This does all the crtc and connector related computations for an atomic |
| 460 | * update and adds any additional connectors needed for full modesets and calls | 460 | * update and adds any additional connectors needed for full modesets and calls |
| 461 | * down into ->mode_fixup functions of the driver backend. | 461 | * down into &drm_crtc_helper_funcs.mode_fixup and |
| 462 | * | 462 | * &drm_encoder_helper_funcs.mode_fixup or |
| 463 | * crtc_state->mode_changed is set when the input mode is changed. | 463 | * &drm_encoder_helper_funcs.atomic_check functions of the driver backend. |
| 464 | * crtc_state->connectors_changed is set when a connector is added or | 464 | * |
| 465 | * removed from the crtc. | 465 | * &drm_crtc_state.mode_changed is set when the input mode is changed. |
| 466 | * crtc_state->active_changed is set when crtc_state->active changes, | 466 | * &drm_crtc_state.connectors_changed is set when a connector is added or |
| 467 | * which is used for dpms. | 467 | * removed from the crtc. &drm_crtc_state.active_changed is set when |
| 468 | * &drm_crtc_state.active changes, which is used for DPMS. | ||
| 468 | * See also: drm_atomic_crtc_needs_modeset() | 469 | * See also: drm_atomic_crtc_needs_modeset() |
| 469 | * | 470 | * |
| 470 | * IMPORTANT: | 471 | * IMPORTANT: |
| 471 | * | 472 | * |
| 472 | * Drivers which set ->mode_changed (e.g. in their ->atomic_check hooks if a | 473 | * Drivers which set &drm_crtc_state.mode_changed (e.g. in their |
| 473 | * plane update can't be done without a full modeset) _must_ call this function | 474 | * &drm_plane_helper_funcs.atomic_check hooks if a plane update can't be done |
| 474 | * afterwards after that change. It is permitted to call this function multiple | 475 | * without a full modeset) _must_ call this function afterwards after that |
| 475 | * times for the same update, e.g. when the ->atomic_check functions depend upon | 476 | * change. It is permitted to call this function multiple times for the same |
| 476 | * the adjusted dotclock for fifo space allocation and watermark computation. | 477 | * update, e.g. when the &drm_crtc_helper_funcs.atomic_check functions depend |
| 478 | * upon the adjusted dotclock for fifo space allocation and watermark | ||
| 479 | * computation. | ||
| 477 | * | 480 | * |
| 478 | * RETURNS: | 481 | * RETURNS: |
| 479 | * Zero for success or -errno | 482 | * Zero for success or -errno |
| @@ -584,9 +587,10 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); | |||
| 584 | * | 587 | * |
| 585 | * Check the state object to see if the requested state is physically possible. | 588 | * Check the state object to see if the requested state is physically possible. |
| 586 | * This does all the plane update related checks using by calling into the | 589 | * This does all the plane update related checks using by calling into the |
| 587 | * ->atomic_check hooks provided by the driver. | 590 | * &drm_crtc_helper_funcs.atomic_check and &drm_plane_helper_funcs.atomic_check |
| 591 | * hooks provided by the driver. | ||
| 588 | * | 592 | * |
| 589 | * It also sets crtc_state->planes_changed to indicate that a crtc has | 593 | * It also sets &drm_crtc_state.planes_changed to indicate that a crtc has |
| 590 | * updated planes. | 594 | * updated planes. |
| 591 | * | 595 | * |
| 592 | * RETURNS: | 596 | * RETURNS: |
| @@ -648,14 +652,15 @@ EXPORT_SYMBOL(drm_atomic_helper_check_planes); | |||
| 648 | * Check the state object to see if the requested state is physically possible. | 652 | * Check the state object to see if the requested state is physically possible. |
| 649 | * Only crtcs and planes have check callbacks, so for any additional (global) | 653 | * Only crtcs and planes have check callbacks, so for any additional (global) |
| 650 | * checking that a driver needs it can simply wrap that around this function. | 654 | * checking that a driver needs it can simply wrap that around this function. |
| 651 | * Drivers without such needs can directly use this as their ->atomic_check() | 655 | * Drivers without such needs can directly use this as their |
| 652 | * callback. | 656 | * &drm_mode_config_funcs.atomic_check callback. |
| 653 | * | 657 | * |
| 654 | * This just wraps the two parts of the state checking for planes and modeset | 658 | * This just wraps the two parts of the state checking for planes and modeset |
| 655 | * state in the default order: First it calls drm_atomic_helper_check_modeset() | 659 | * state in the default order: First it calls drm_atomic_helper_check_modeset() |
| 656 | * and then drm_atomic_helper_check_planes(). The assumption is that the | 660 | * and then drm_atomic_helper_check_planes(). The assumption is that the |
| 657 | * ->atomic_check functions depend upon an updated adjusted_mode.clock to | 661 | * @drm_plane_helper_funcs.atomic_check and @drm_crtc_helper_funcs.atomic_check |
| 658 | * e.g. properly compute watermarks. | 662 | * functions depend upon an updated adjusted_mode.clock to e.g. properly compute |
| 663 | * watermarks. | ||
| 659 | * | 664 | * |
| 660 | * RETURNS: | 665 | * RETURNS: |
| 661 | * Zero for success or -errno | 666 | * Zero for success or -errno |
| @@ -1125,8 +1130,8 @@ EXPORT_SYMBOL(drm_atomic_helper_wait_for_vblanks); | |||
| 1125 | * drm_atomic_helper_commit_tail - commit atomic update to hardware | 1130 | * drm_atomic_helper_commit_tail - commit atomic update to hardware |
| 1126 | * @old_state: atomic state object with old state structures | 1131 | * @old_state: atomic state object with old state structures |
| 1127 | * | 1132 | * |
| 1128 | * This is the default implemenation for the ->atomic_commit_tail() hook of the | 1133 | * This is the default implementation for the |
| 1129 | * &drm_mode_config_helper_funcs vtable. | 1134 | * &drm_mode_config_helper_funcs.atomic_commit_tail hook. |
| 1130 | * | 1135 | * |
| 1131 | * Note that the default ordering of how the various stages are called is to | 1136 | * Note that the default ordering of how the various stages are called is to |
| 1132 | * match the legacy modeset helper library closest. One peculiarity of that is | 1137 | * match the legacy modeset helper library closest. One peculiarity of that is |
| @@ -1203,8 +1208,8 @@ static void commit_work(struct work_struct *work) | |||
| 1203 | * drm_atomic_helper_setup_commit() and related functions. | 1208 | * drm_atomic_helper_setup_commit() and related functions. |
| 1204 | * | 1209 | * |
| 1205 | * Committing the actual hardware state is done through the | 1210 | * Committing the actual hardware state is done through the |
| 1206 | * ->atomic_commit_tail() callback of the &drm_mode_config_helper_funcs vtable, | 1211 | * &drm_mode_config_helper_funcs.atomic_commit_tail callback, or it's default |
| 1207 | * or it's default implementation drm_atomic_helper_commit_tail(). | 1212 | * implementation drm_atomic_helper_commit_tail(). |
| 1208 | * | 1213 | * |
| 1209 | * RETURNS: | 1214 | * RETURNS: |
| 1210 | * Zero for success or -errno. | 1215 | * Zero for success or -errno. |
| @@ -1357,7 +1362,7 @@ static int stall_checks(struct drm_crtc *crtc, bool nonblock) | |||
| 1357 | return ret < 0 ? ret : 0; | 1362 | return ret < 0 ? ret : 0; |
| 1358 | } | 1363 | } |
| 1359 | 1364 | ||
| 1360 | void release_crtc_commit(struct completion *completion) | 1365 | static void release_crtc_commit(struct completion *completion) |
| 1361 | { | 1366 | { |
| 1362 | struct drm_crtc_commit *commit = container_of(completion, | 1367 | struct drm_crtc_commit *commit = container_of(completion, |
| 1363 | typeof(*commit), | 1368 | typeof(*commit), |
| @@ -1373,14 +1378,15 @@ void release_crtc_commit(struct completion *completion) | |||
| 1373 | * | 1378 | * |
| 1374 | * This function prepares @state to be used by the atomic helper's support for | 1379 | * This function prepares @state to be used by the atomic helper's support for |
| 1375 | * nonblocking commits. Drivers using the nonblocking commit infrastructure | 1380 | * nonblocking commits. Drivers using the nonblocking commit infrastructure |
| 1376 | * should always call this function from their ->atomic_commit hook. | 1381 | * should always call this function from their |
| 1382 | * &drm_mode_config_funcs.atomic_commit hook. | ||
| 1377 | * | 1383 | * |
| 1378 | * To be able to use this support drivers need to use a few more helper | 1384 | * To be able to use this support drivers need to use a few more helper |
| 1379 | * functions. drm_atomic_helper_wait_for_dependencies() must be called before | 1385 | * functions. drm_atomic_helper_wait_for_dependencies() must be called before |
| 1380 | * actually committing the hardware state, and for nonblocking commits this call | 1386 | * actually committing the hardware state, and for nonblocking commits this call |
| 1381 | * must be placed in the async worker. See also drm_atomic_helper_swap_state() | 1387 | * must be placed in the async worker. See also drm_atomic_helper_swap_state() |
| 1382 | * and it's stall parameter, for when a driver's commit hooks look at the | 1388 | * and it's stall parameter, for when a driver's commit hooks look at the |
| 1383 | * ->state pointers of &struct drm_crtc, &drm_plane or &drm_connector directly. | 1389 | * &drm_crtc.state, &drm_plane.state or &drm_connector.state pointer directly. |
| 1384 | * | 1390 | * |
| 1385 | * Completion of the hardware commit step must be signalled using | 1391 | * Completion of the hardware commit step must be signalled using |
| 1386 | * drm_atomic_helper_commit_hw_done(). After this step the driver is not allowed | 1392 | * drm_atomic_helper_commit_hw_done(). After this step the driver is not allowed |
| @@ -1489,8 +1495,7 @@ static struct drm_crtc_commit *preceeding_commit(struct drm_crtc *crtc) | |||
| 1489 | * This function waits for all preceeding commits that touch the same CRTC as | 1495 | * This function waits for all preceeding commits that touch the same CRTC as |
| 1490 | * @old_state to both be committed to the hardware (as signalled by | 1496 | * @old_state to both be committed to the hardware (as signalled by |
| 1491 | * drm_atomic_helper_commit_hw_done) and executed by the hardware (as signalled | 1497 | * drm_atomic_helper_commit_hw_done) and executed by the hardware (as signalled |
| 1492 | * by calling drm_crtc_vblank_send_event on the event member of | 1498 | * by calling drm_crtc_vblank_send_event() on the &drm_crtc_state.event). |
| 1493 | * &drm_crtc_state). | ||
| 1494 | * | 1499 | * |
| 1495 | * This is part of the atomic helper support for nonblocking commits, see | 1500 | * This is part of the atomic helper support for nonblocking commits, see |
| 1496 | * drm_atomic_helper_setup_commit() for an overview. | 1501 | * drm_atomic_helper_setup_commit() for an overview. |
| @@ -1627,8 +1632,9 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_cleanup_done); | |||
| 1627 | * @state: atomic state object with new state structures | 1632 | * @state: atomic state object with new state structures |
| 1628 | * | 1633 | * |
| 1629 | * This function prepares plane state, specifically framebuffers, for the new | 1634 | * This function prepares plane state, specifically framebuffers, for the new |
| 1630 | * configuration. If any failure is encountered this function will call | 1635 | * configuration, by calling &drm_plane_helper_funcs.prepare_fb. If any failure |
| 1631 | * ->cleanup_fb on any already successfully prepared framebuffer. | 1636 | * is encountered this function will call &drm_plane_helper_funcs.cleanup_fb on |
| 1637 | * any already successfully prepared framebuffer. | ||
| 1632 | * | 1638 | * |
| 1633 | * Returns: | 1639 | * Returns: |
| 1634 | * 0 on success, negative error code on failure. | 1640 | * 0 on success, negative error code on failure. |
| @@ -1708,10 +1714,10 @@ static bool plane_crtc_active(const struct drm_plane_state *state) | |||
| 1708 | * | 1714 | * |
| 1709 | * Drivers may set the NO_DISABLE_AFTER_MODESET flag in @flags if the relevant | 1715 | * Drivers may set the NO_DISABLE_AFTER_MODESET flag in @flags if the relevant |
| 1710 | * display controllers require to disable a CRTC's planes when the CRTC is | 1716 | * display controllers require to disable a CRTC's planes when the CRTC is |
| 1711 | * disabled. This function would skip the ->atomic_disable call for a plane if | 1717 | * disabled. This function would skip the &drm_plane_helper_funcs.atomic_disable |
| 1712 | * the CRTC of the old plane state needs a modesetting operation. Of course, | 1718 | * call for a plane if the CRTC of the old plane state needs a modesetting |
| 1713 | * the drivers need to disable the planes in their CRTC disable callbacks | 1719 | * operation. Of course, the drivers need to disable the planes in their CRTC |
| 1714 | * since no one else would do that. | 1720 | * disable callbacks since no one else would do that. |
| 1715 | * | 1721 | * |
| 1716 | * The drm_atomic_helper_commit() default implementation doesn't set the | 1722 | * The drm_atomic_helper_commit() default implementation doesn't set the |
| 1717 | * ACTIVE_ONLY flag to most closely match the behaviour of the legacy helpers. | 1723 | * ACTIVE_ONLY flag to most closely match the behaviour of the legacy helpers. |
| @@ -1874,7 +1880,7 @@ EXPORT_SYMBOL(drm_atomic_helper_commit_planes_on_crtc); | |||
| 1874 | * planes. | 1880 | * planes. |
| 1875 | * | 1881 | * |
| 1876 | * It is a bug to call this function without having implemented the | 1882 | * It is a bug to call this function without having implemented the |
| 1877 | * ->atomic_disable() plane hook. | 1883 | * &drm_plane_helper_funcs.atomic_disable plane hook. |
| 1878 | */ | 1884 | */ |
| 1879 | void | 1885 | void |
| 1880 | drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state, | 1886 | drm_atomic_helper_disable_planes_on_crtc(struct drm_crtc_state *old_crtc_state, |
| @@ -1961,8 +1967,8 @@ EXPORT_SYMBOL(drm_atomic_helper_cleanup_planes); | |||
| 1961 | * contains the old state. Also do any other cleanup required with that state. | 1967 | * contains the old state. Also do any other cleanup required with that state. |
| 1962 | * | 1968 | * |
| 1963 | * @stall must be set when nonblocking commits for this driver directly access | 1969 | * @stall must be set when nonblocking commits for this driver directly access |
| 1964 | * the ->state pointer of &drm_plane, &drm_crtc or &drm_connector. With the | 1970 | * the &drm_plane.state, &drm_crtc.state or &drm_connector.state pointer. With |
| 1965 | * current atomic helpers this is almost always the case, since the helpers | 1971 | * the current atomic helpers this is almost always the case, since the helpers |
| 1966 | * don't pass the right state structures to the callbacks. | 1972 | * don't pass the right state structures to the callbacks. |
| 1967 | */ | 1973 | */ |
| 1968 | void drm_atomic_helper_swap_state(struct drm_atomic_state *state, | 1974 | void drm_atomic_helper_swap_state(struct drm_atomic_state *state, |
| @@ -2363,7 +2369,7 @@ int __drm_atomic_helper_set_config(struct drm_mode_set *set, | |||
| 2363 | if (ret != 0) | 2369 | if (ret != 0) |
| 2364 | return ret; | 2370 | return ret; |
| 2365 | 2371 | ||
| 2366 | drm_crtc_get_hv_timing(set->mode, &hdisplay, &vdisplay); | 2372 | drm_mode_get_hv_timing(set->mode, &hdisplay, &vdisplay); |
| 2367 | 2373 | ||
| 2368 | drm_atomic_set_fb_for_plane(primary_state, set->fb); | 2374 | drm_atomic_set_fb_for_plane(primary_state, set->fb); |
| 2369 | primary_state->crtc_x = 0; | 2375 | primary_state->crtc_x = 0; |
| @@ -2892,8 +2898,8 @@ EXPORT_SYMBOL(drm_atomic_helper_page_flip_target); | |||
| 2892 | * | 2898 | * |
| 2893 | * This is the main helper function provided by the atomic helper framework for | 2899 | * This is the main helper function provided by the atomic helper framework for |
| 2894 | * implementing the legacy DPMS connector interface. It computes the new desired | 2900 | * implementing the legacy DPMS connector interface. It computes the new desired |
| 2895 | * ->active state for the corresponding CRTC (if the connector is enabled) and | 2901 | * &drm_crtc_state.active state for the corresponding CRTC (if the connector is |
| 2896 | * updates it. | 2902 | * enabled) and updates it. |
| 2897 | * | 2903 | * |
| 2898 | * Returns: | 2904 | * Returns: |
| 2899 | * Returns 0 on success, negative errno numbers on failure. | 2905 | * Returns 0 on success, negative errno numbers on failure. |
| @@ -2965,11 +2971,11 @@ backoff: | |||
| 2965 | EXPORT_SYMBOL(drm_atomic_helper_connector_dpms); | 2971 | EXPORT_SYMBOL(drm_atomic_helper_connector_dpms); |
| 2966 | 2972 | ||
| 2967 | /** | 2973 | /** |
| 2968 | * drm_atomic_helper_best_encoder - Helper for &drm_connector_helper_funcs | 2974 | * drm_atomic_helper_best_encoder - Helper for |
| 2969 | * ->best_encoder callback | 2975 | * &drm_connector_helper_funcs.best_encoder callback |
| 2970 | * @connector: Connector control structure | 2976 | * @connector: Connector control structure |
| 2971 | * | 2977 | * |
| 2972 | * This is a &drm_connector_helper_funcs ->best_encoder callback helper for | 2978 | * This is a &drm_connector_helper_funcs.best_encoder callback helper for |
| 2973 | * connectors that support exactly 1 encoder, statically determined at driver | 2979 | * connectors that support exactly 1 encoder, statically determined at driver |
| 2974 | * init time. | 2980 | * init time. |
| 2975 | */ | 2981 | */ |
| @@ -3003,7 +3009,7 @@ EXPORT_SYMBOL(drm_atomic_helper_best_encoder); | |||
| 3003 | */ | 3009 | */ |
| 3004 | 3010 | ||
| 3005 | /** | 3011 | /** |
| 3006 | * drm_atomic_helper_crtc_reset - default ->reset hook for CRTCs | 3012 | * drm_atomic_helper_crtc_reset - default &drm_crtc_funcs.reset hook for CRTCs |
| 3007 | * @crtc: drm CRTC | 3013 | * @crtc: drm CRTC |
| 3008 | * | 3014 | * |
| 3009 | * Resets the atomic state for @crtc by freeing the state pointer (which might | 3015 | * Resets the atomic state for @crtc by freeing the state pointer (which might |
| @@ -3110,7 +3116,7 @@ void drm_atomic_helper_crtc_destroy_state(struct drm_crtc *crtc, | |||
| 3110 | EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state); | 3116 | EXPORT_SYMBOL(drm_atomic_helper_crtc_destroy_state); |
| 3111 | 3117 | ||
| 3112 | /** | 3118 | /** |
| 3113 | * drm_atomic_helper_plane_reset - default ->reset hook for planes | 3119 | * drm_atomic_helper_plane_reset - default &drm_plane_funcs.reset hook for planes |
| 3114 | * @plane: drm plane | 3120 | * @plane: drm plane |
| 3115 | * | 3121 | * |
| 3116 | * Resets the atomic state for @plane by freeing the state pointer (which might | 3122 | * Resets the atomic state for @plane by freeing the state pointer (which might |
| @@ -3214,8 +3220,9 @@ EXPORT_SYMBOL(drm_atomic_helper_plane_destroy_state); | |||
| 3214 | * @conn_state: connector state to assign | 3220 | * @conn_state: connector state to assign |
| 3215 | * | 3221 | * |
| 3216 | * Initializes the newly allocated @conn_state and assigns it to | 3222 | * Initializes the newly allocated @conn_state and assigns it to |
| 3217 | * #connector ->state, usually required when initializing the drivers | 3223 | * the &drm_conector->state pointer of @connector, usually required when |
| 3218 | * or when called from the ->reset hook. | 3224 | * initializing the drivers or when called from the &drm_connector_funcs.reset |
| 3225 | * hook. | ||
| 3219 | * | 3226 | * |
| 3220 | * This is useful for drivers that subclass the connector state. | 3227 | * This is useful for drivers that subclass the connector state. |
| 3221 | */ | 3228 | */ |
| @@ -3231,7 +3238,7 @@ __drm_atomic_helper_connector_reset(struct drm_connector *connector, | |||
| 3231 | EXPORT_SYMBOL(__drm_atomic_helper_connector_reset); | 3238 | EXPORT_SYMBOL(__drm_atomic_helper_connector_reset); |
| 3232 | 3239 | ||
| 3233 | /** | 3240 | /** |
| 3234 | * drm_atomic_helper_connector_reset - default ->reset hook for connectors | 3241 | * drm_atomic_helper_connector_reset - default &drm_connector_funcs.reset hook for connectors |
| 3235 | * @connector: drm connector | 3242 | * @connector: drm connector |
| 3236 | * | 3243 | * |
| 3237 | * Resets the atomic state for @connector by freeing the state pointer (which | 3244 | * Resets the atomic state for @connector by freeing the state pointer (which |
diff --git a/drivers/gpu/drm/drm_auth.c b/drivers/gpu/drm/drm_auth.c index 860cfe124c2a..7ff697389d74 100644 --- a/drivers/gpu/drm/drm_auth.c +++ b/drivers/gpu/drm/drm_auth.c | |||
| @@ -40,8 +40,8 @@ | |||
| 40 | * least once successfully became the device master (either through the | 40 | * least once successfully became the device master (either through the |
| 41 | * SET_MASTER IOCTL, or implicitly through opening the primary device node when | 41 | * SET_MASTER IOCTL, or implicitly through opening the primary device node when |
| 42 | * no one else is the current master that time) there exists one &drm_master. | 42 | * no one else is the current master that time) there exists one &drm_master. |
| 43 | * This is noted in the is_master member of &drm_file. All other clients have | 43 | * This is noted in &drm_file.is_master. All other clients have just a pointer |
| 44 | * just a pointer to the &drm_master they are associated with. | 44 | * to the &drm_master they are associated with. |
| 45 | * | 45 | * |
| 46 | * In addition only one &drm_master can be the current master for a &drm_device. | 46 | * In addition only one &drm_master can be the current master for a &drm_device. |
| 47 | * It can be switched through the DROP_MASTER and SET_MASTER IOCTL, or | 47 | * It can be switched through the DROP_MASTER and SET_MASTER IOCTL, or |
diff --git a/drivers/gpu/drm/drm_blend.c b/drivers/gpu/drm/drm_blend.c index 1f2412c7ccfd..665aafc6ad68 100644 --- a/drivers/gpu/drm/drm_blend.c +++ b/drivers/gpu/drm/drm_blend.c | |||
| @@ -40,9 +40,8 @@ | |||
| 40 | * sub-pixel accuracy, which is scaled up to a pixel-aligned destination | 40 | * sub-pixel accuracy, which is scaled up to a pixel-aligned destination |
| 41 | * rectangle in the visible area of a &drm_crtc. The visible area of a CRTC is | 41 | * rectangle in the visible area of a &drm_crtc. The visible area of a CRTC is |
| 42 | * defined by the horizontal and vertical visible pixels (stored in @hdisplay | 42 | * defined by the horizontal and vertical visible pixels (stored in @hdisplay |
| 43 | * and @vdisplay) of the requested mode (stored in @mode in the | 43 | * and @vdisplay) of the requested mode (stored in &drm_crtc_state.mode). These |
| 44 | * &drm_crtc_state). These two rectangles are both stored in the | 44 | * two rectangles are both stored in the &drm_plane_state. |
| 45 | * &drm_plane_state. | ||
| 46 | * | 45 | * |
| 47 | * For the atomic ioctl the following standard (atomic) properties on the plane object | 46 | * For the atomic ioctl the following standard (atomic) properties on the plane object |
| 48 | * encode the basic plane composition model: | 47 | * encode the basic plane composition model: |
| @@ -215,7 +214,7 @@ EXPORT_SYMBOL(drm_rotation_simplify); | |||
| 215 | * for it in drm core. Drivers can then attach this property to planes to enable | 214 | * for it in drm core. Drivers can then attach this property to planes to enable |
| 216 | * support for configurable planes arrangement during blending operation. | 215 | * support for configurable planes arrangement during blending operation. |
| 217 | * Once mutable zpos property has been enabled, the DRM core will automatically | 216 | * Once mutable zpos property has been enabled, the DRM core will automatically |
| 218 | * calculate drm_plane_state->normalized_zpos values. Usually min should be set | 217 | * calculate &drm_plane_state.normalized_zpos values. Usually min should be set |
| 219 | * to 0 and max to maximal number of planes for given crtc - 1. | 218 | * to 0 and max to maximal number of planes for given crtc - 1. |
| 220 | * | 219 | * |
| 221 | * If zpos of some planes cannot be changed (like fixed background or | 220 | * If zpos of some planes cannot be changed (like fixed background or |
| @@ -367,8 +366,8 @@ done: | |||
| 367 | * For every CRTC this function checks new states of all planes assigned to | 366 | * For every CRTC this function checks new states of all planes assigned to |
| 368 | * it and calculates normalized zpos value for these planes. Planes are compared | 367 | * it and calculates normalized zpos value for these planes. Planes are compared |
| 369 | * first by their zpos values, then by plane id (if zpos is equal). The plane | 368 | * first by their zpos values, then by plane id (if zpos is equal). The plane |
| 370 | * with lowest zpos value is at the bottom. The plane_state->normalized_zpos is | 369 | * with lowest zpos value is at the bottom. The &drm_plane_state.normalized_zpos |
| 371 | * then filled with unique values from 0 to number of active planes in crtc | 370 | * is then filled with unique values from 0 to number of active planes in crtc |
| 372 | * minus one. | 371 | * minus one. |
| 373 | * | 372 | * |
| 374 | * RETURNS | 373 | * RETURNS |
diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index 5066638928ec..c3b9aaccdf42 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c | |||
| @@ -29,7 +29,9 @@ | |||
| 29 | */ | 29 | */ |
| 30 | 30 | ||
| 31 | #include <linux/export.h> | 31 | #include <linux/export.h> |
| 32 | #include <drm/drmP.h> | 32 | #include <linux/highmem.h> |
| 33 | |||
| 34 | #include <drm/drm_cache.h> | ||
| 33 | 35 | ||
| 34 | #if defined(CONFIG_X86) | 36 | #if defined(CONFIG_X86) |
| 35 | #include <asm/smp.h> | 37 | #include <asm/smp.h> |
diff --git a/drivers/gpu/drm/drm_connector.c b/drivers/gpu/drm/drm_connector.c index 799edd0d308e..e4d2c8a49076 100644 --- a/drivers/gpu/drm/drm_connector.c +++ b/drivers/gpu/drm/drm_connector.c | |||
| @@ -38,18 +38,17 @@ | |||
| 38 | * Hence they are reference-counted using drm_connector_reference() and | 38 | * Hence they are reference-counted using drm_connector_reference() and |
| 39 | * drm_connector_unreference(). | 39 | * drm_connector_unreference(). |
| 40 | * | 40 | * |
| 41 | * KMS driver must create, initialize, register and attach at a struct | 41 | * KMS driver must create, initialize, register and attach at a &struct |
| 42 | * &drm_connector for each such sink. The instance is created as other KMS | 42 | * drm_connector for each such sink. The instance is created as other KMS |
| 43 | * objects and initialized by setting the following fields. | 43 | * objects and initialized by setting the following fields. The connector is |
| 44 | * | 44 | * initialized with a call to drm_connector_init() with a pointer to the |
| 45 | * The connector is then registered with a call to drm_connector_init() with a | 45 | * &struct drm_connector_funcs and a connector type, and then exposed to |
| 46 | * pointer to the connector functions and a connector type, and exposed through | 46 | * userspace with a call to drm_connector_register(). |
| 47 | * sysfs with a call to drm_connector_register(). | ||
| 48 | * | 47 | * |
| 49 | * Connectors must be attached to an encoder to be used. For devices that map | 48 | * Connectors must be attached to an encoder to be used. For devices that map |
| 50 | * connectors to encoders 1:1, the connector should be attached at | 49 | * connectors to encoders 1:1, the connector should be attached at |
| 51 | * initialization time with a call to drm_mode_connector_attach_encoder(). The | 50 | * initialization time with a call to drm_mode_connector_attach_encoder(). The |
| 52 | * driver must also set the &struct drm_connector encoder field to point to the | 51 | * driver must also set the &drm_connector.encoder field to point to the |
| 53 | * attached encoder. | 52 | * attached encoder. |
| 54 | * | 53 | * |
| 55 | * For connectors which are not fixed (like built-in panels) the driver needs to | 54 | * For connectors which are not fixed (like built-in panels) the driver needs to |
| @@ -497,7 +496,7 @@ static struct lockdep_map connector_list_iter_dep_map = { | |||
| 497 | * @dev: DRM device | 496 | * @dev: DRM device |
| 498 | * @iter: connector_list iterator | 497 | * @iter: connector_list iterator |
| 499 | * | 498 | * |
| 500 | * Sets @iter up to walk the connector list in &drm_mode_config of @dev. @iter | 499 | * Sets @iter up to walk the &drm_mode_config.connector_list of @dev. @iter |
| 501 | * must always be cleaned up again by calling drm_connector_list_iter_put(). | 500 | * must always be cleaned up again by calling drm_connector_list_iter_put(). |
| 502 | * Iteration itself happens using drm_connector_list_iter_next() or | 501 | * Iteration itself happens using drm_connector_list_iter_next() or |
| 503 | * drm_for_each_connector_iter(). | 502 | * drm_for_each_connector_iter(). |
| @@ -696,8 +695,8 @@ DRM_ENUM_NAME_FN(drm_get_tv_subconnector_name, | |||
| 696 | * drivers this is only provided for backwards compatibility with existing | 695 | * drivers this is only provided for backwards compatibility with existing |
| 697 | * drivers, it remaps to controlling the "ACTIVE" property on the CRTC the | 696 | * drivers, it remaps to controlling the "ACTIVE" property on the CRTC the |
| 698 | * connector is linked to. Drivers should never set this property directly, | 697 | * connector is linked to. Drivers should never set this property directly, |
| 699 | * it is handled by the DRM core by calling the ->dpms() callback in | 698 | * it is handled by the DRM core by calling the &drm_connector_funcs.dpms |
| 700 | * &drm_connector_funcs. Atomic drivers should implement this hook using | 699 | * callback. Atomic drivers should implement this hook using |
| 701 | * drm_atomic_helper_connector_dpms(). This is the only property standard | 700 | * drm_atomic_helper_connector_dpms(). This is the only property standard |
| 702 | * connector property that userspace can change. | 701 | * connector property that userspace can change. |
| 703 | * PATH: | 702 | * PATH: |
diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c index bd3c8b243447..6915f897bd8e 100644 --- a/drivers/gpu/drm/drm_crtc.c +++ b/drivers/gpu/drm/drm_crtc.c | |||
| @@ -47,6 +47,27 @@ | |||
| 47 | #include "drm_internal.h" | 47 | #include "drm_internal.h" |
| 48 | 48 | ||
| 49 | /** | 49 | /** |
| 50 | * DOC: overview | ||
| 51 | * | ||
| 52 | * A CRTC represents the overall display pipeline. It receives pixel data from | ||
| 53 | * &drm_plane and blends them together. The &drm_display_mode is also attached | ||
| 54 | * to the CRTC, specifying display timings. On the output side the data is fed | ||
| 55 | * to one or more &drm_encoder, which are then each connected to one | ||
| 56 | * &drm_connector. | ||
| 57 | * | ||
| 58 | * To create a CRTC, a KMS drivers allocates and zeroes an instances of | ||
| 59 | * &struct drm_crtc (possibly as part of a larger structure) and registers it | ||
| 60 | * with a call to drm_crtc_init_with_planes(). | ||
| 61 | * | ||
| 62 | * The CRTC is also the entry point for legacy modeset operations, see | ||
| 63 | * &drm_crtc_funcs.set_config, legacy plane operations, see | ||
| 64 | * &drm_crtc_funcs.page_flip and &drm_crtc_funcs.cursor_set2, and other legacy | ||
| 65 | * operations like &drm_crtc_funcs.gamma_set. For atomic drivers all these | ||
| 66 | * features are controlled through &drm_property and | ||
| 67 | * &drm_mode_config_funcs.atomic_check and &drm_mode_config_funcs.atomic_check. | ||
| 68 | */ | ||
| 69 | |||
| 70 | /** | ||
| 50 | * drm_crtc_from_index - find the registered CRTC at an index | 71 | * drm_crtc_from_index - find the registered CRTC at an index |
| 51 | * @dev: DRM device | 72 | * @dev: DRM device |
| 52 | * @idx: index of registered CRTC to find for | 73 | * @idx: index of registered CRTC to find for |
| @@ -415,11 +436,12 @@ int drm_mode_getcrtc(struct drm_device *dev, | |||
| 415 | } | 436 | } |
| 416 | 437 | ||
| 417 | /** | 438 | /** |
| 418 | * drm_mode_set_config_internal - helper to call ->set_config | 439 | * drm_mode_set_config_internal - helper to call &drm_mode_config_funcs.set_config |
| 419 | * @set: modeset config to set | 440 | * @set: modeset config to set |
| 420 | * | 441 | * |
| 421 | * This is a little helper to wrap internal calls to the ->set_config driver | 442 | * This is a little helper to wrap internal calls to the |
| 422 | * interface. The only thing it adds is correct refcounting dance. | 443 | * &drm_mode_config_funcs.set_config driver interface. The only thing it adds is |
| 444 | * correct refcounting dance. | ||
| 423 | * | 445 | * |
| 424 | * Returns: | 446 | * Returns: |
| 425 | * Zero on success, negative errno on failure. | 447 | * Zero on success, negative errno on failure. |
| @@ -460,27 +482,6 @@ int drm_mode_set_config_internal(struct drm_mode_set *set) | |||
| 460 | EXPORT_SYMBOL(drm_mode_set_config_internal); | 482 | EXPORT_SYMBOL(drm_mode_set_config_internal); |
| 461 | 483 | ||
| 462 | /** | 484 | /** |
| 463 | * drm_crtc_get_hv_timing - Fetches hdisplay/vdisplay for given mode | ||
| 464 | * @mode: mode to query | ||
| 465 | * @hdisplay: hdisplay value to fill in | ||
| 466 | * @vdisplay: vdisplay value to fill in | ||
| 467 | * | ||
| 468 | * The vdisplay value will be doubled if the specified mode is a stereo mode of | ||
| 469 | * the appropriate layout. | ||
| 470 | */ | ||
| 471 | void drm_crtc_get_hv_timing(const struct drm_display_mode *mode, | ||
| 472 | int *hdisplay, int *vdisplay) | ||
| 473 | { | ||
| 474 | struct drm_display_mode adjusted; | ||
| 475 | |||
| 476 | drm_mode_copy(&adjusted, mode); | ||
| 477 | drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY); | ||
| 478 | *hdisplay = adjusted.crtc_hdisplay; | ||
| 479 | *vdisplay = adjusted.crtc_vdisplay; | ||
| 480 | } | ||
| 481 | EXPORT_SYMBOL(drm_crtc_get_hv_timing); | ||
| 482 | |||
| 483 | /** | ||
| 484 | * drm_crtc_check_viewport - Checks that a framebuffer is big enough for the | 485 | * drm_crtc_check_viewport - Checks that a framebuffer is big enough for the |
| 485 | * CRTC viewport | 486 | * CRTC viewport |
| 486 | * @crtc: CRTC that framebuffer will be displayed on | 487 | * @crtc: CRTC that framebuffer will be displayed on |
| @@ -497,7 +498,7 @@ int drm_crtc_check_viewport(const struct drm_crtc *crtc, | |||
| 497 | { | 498 | { |
| 498 | int hdisplay, vdisplay; | 499 | int hdisplay, vdisplay; |
| 499 | 500 | ||
| 500 | drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay); | 501 | drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay); |
| 501 | 502 | ||
| 502 | if (crtc->state && | 503 | if (crtc->state && |
| 503 | drm_rotation_90_or_270(crtc->primary->state->rotation)) | 504 | drm_rotation_90_or_270(crtc->primary->state->rotation)) |
diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 1e281dd42e4b..44ba0e990d6c 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c | |||
| @@ -53,9 +53,9 @@ | |||
| 53 | * configuration on resume with drm_helper_resume_force_mode(). | 53 | * configuration on resume with drm_helper_resume_force_mode(). |
| 54 | * | 54 | * |
| 55 | * Note that this helper library doesn't track the current power state of CRTCs | 55 | * Note that this helper library doesn't track the current power state of CRTCs |
| 56 | * and encoders. It can call callbacks like ->dpms() even though the hardware is | 56 | * and encoders. It can call callbacks like &drm_encoder_helper_funcs.dpms even |
| 57 | * already in the desired state. This deficiency has been fixed in the atomic | 57 | * though the hardware is already in the desired state. This deficiency has been |
| 58 | * helpers. | 58 | * fixed in the atomic helpers. |
| 59 | * | 59 | * |
| 60 | * The driver callbacks are mostly compatible with the atomic modeset helpers, | 60 | * The driver callbacks are mostly compatible with the atomic modeset helpers, |
| 61 | * except for the handling of the primary plane: Atomic helpers require that the | 61 | * except for the handling of the primary plane: Atomic helpers require that the |
| @@ -477,12 +477,12 @@ drm_crtc_helper_disable(struct drm_crtc *crtc) | |||
| 477 | * drm_crtc_helper_set_config - set a new config from userspace | 477 | * drm_crtc_helper_set_config - set a new config from userspace |
| 478 | * @set: mode set configuration | 478 | * @set: mode set configuration |
| 479 | * | 479 | * |
| 480 | * The drm_crtc_helper_set_config() helper function implements the set_config | 480 | * The drm_crtc_helper_set_config() helper function implements the of |
| 481 | * callback of &struct drm_crtc_funcs for drivers using the legacy CRTC helpers. | 481 | * &drm_crtc_funcs.set_config callback for drivers using the legacy CRTC |
| 482 | * helpers. | ||
| 482 | * | 483 | * |
| 483 | * It first tries to locate the best encoder for each connector by calling the | 484 | * It first tries to locate the best encoder for each connector by calling the |
| 484 | * connector ->best_encoder() (&struct drm_connector_helper_funcs) helper | 485 | * connector @drm_connector_helper_funcs.best_encoder helper operation. |
| 485 | * operation. | ||
| 486 | * | 486 | * |
| 487 | * After locating the appropriate encoders, the helper function will call the | 487 | * After locating the appropriate encoders, the helper function will call the |
| 488 | * mode_fixup encoder and CRTC helper operations to adjust the requested mode, | 488 | * mode_fixup encoder and CRTC helper operations to adjust the requested mode, |
| @@ -493,8 +493,7 @@ drm_crtc_helper_disable(struct drm_crtc *crtc) | |||
| 493 | * | 493 | * |
| 494 | * If the adjusted mode is identical to the current mode but changes to the | 494 | * If the adjusted mode is identical to the current mode but changes to the |
| 495 | * frame buffer need to be applied, the drm_crtc_helper_set_config() function | 495 | * frame buffer need to be applied, the drm_crtc_helper_set_config() function |
| 496 | * will call the CRTC ->mode_set_base() (&struct drm_crtc_helper_funcs) helper | 496 | * will call the CRTC &drm_crtc_helper_funcs.mode_set_base helper operation. |
| 497 | * operation. | ||
| 498 | * | 497 | * |
| 499 | * If the adjusted mode differs from the current mode, or if the | 498 | * If the adjusted mode differs from the current mode, or if the |
| 500 | * ->mode_set_base() helper operation is not provided, the helper function | 499 | * ->mode_set_base() helper operation is not provided, the helper function |
| @@ -851,14 +850,15 @@ static int drm_helper_choose_crtc_dpms(struct drm_crtc *crtc) | |||
| 851 | * @connector: affected connector | 850 | * @connector: affected connector |
| 852 | * @mode: DPMS mode | 851 | * @mode: DPMS mode |
| 853 | * | 852 | * |
| 854 | * The drm_helper_connector_dpms() helper function implements the ->dpms() | 853 | * The drm_helper_connector_dpms() helper function implements the |
| 855 | * callback of &struct drm_connector_funcs for drivers using the legacy CRTC helpers. | 854 | * &drm_connector_funcs.dpms callback for drivers using the legacy CRTC |
| 855 | * helpers. | ||
| 856 | * | 856 | * |
| 857 | * This is the main helper function provided by the CRTC helper framework for | 857 | * This is the main helper function provided by the CRTC helper framework for |
| 858 | * implementing the DPMS connector attribute. It computes the new desired DPMS | 858 | * implementing the DPMS connector attribute. It computes the new desired DPMS |
| 859 | * state for all encoders and CRTCs in the output mesh and calls the ->dpms() | 859 | * state for all encoders and CRTCs in the output mesh and calls the |
| 860 | * callbacks provided by the driver in &struct drm_crtc_helper_funcs and struct | 860 | * &drm_crtc_helper_funcs.dpms and &drm_encoder_helper_funcs.dpms callbacks |
| 861 | * &drm_encoder_helper_funcs appropriately. | 861 | * provided by the driver. |
| 862 | * | 862 | * |
| 863 | * This function is deprecated. New drivers must implement atomic modeset | 863 | * This function is deprecated. New drivers must implement atomic modeset |
| 864 | * support, for which this function is unsuitable. Instead drivers should use | 864 | * support, for which this function is unsuitable. Instead drivers should use |
diff --git a/drivers/gpu/drm/drm_crtc_internal.h b/drivers/gpu/drm/drm_crtc_internal.h index 724c329186d5..1bdcfd566695 100644 --- a/drivers/gpu/drm/drm_crtc_internal.h +++ b/drivers/gpu/drm/drm_crtc_internal.h | |||
| @@ -177,7 +177,6 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev, | |||
| 177 | #ifdef CONFIG_DEBUG_FS | 177 | #ifdef CONFIG_DEBUG_FS |
| 178 | struct drm_minor; | 178 | struct drm_minor; |
| 179 | int drm_atomic_debugfs_init(struct drm_minor *minor); | 179 | int drm_atomic_debugfs_init(struct drm_minor *minor); |
| 180 | int drm_atomic_debugfs_cleanup(struct drm_minor *minor); | ||
| 181 | #endif | 180 | #endif |
| 182 | 181 | ||
| 183 | int drm_atomic_get_property(struct drm_mode_object *obj, | 182 | int drm_atomic_get_property(struct drm_mode_object *obj, |
diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c index 37fd612d57a6..2290a74a6e46 100644 --- a/drivers/gpu/drm/drm_debugfs.c +++ b/drivers/gpu/drm/drm_debugfs.c | |||
| @@ -81,7 +81,8 @@ static const struct file_operations drm_debugfs_fops = { | |||
| 81 | * \return Zero on success, non-zero on failure | 81 | * \return Zero on success, non-zero on failure |
| 82 | * | 82 | * |
| 83 | * Create a given set of debugfs files represented by an array of | 83 | * Create a given set of debugfs files represented by an array of |
| 84 | * gdm_debugfs_lists in the given root directory. | 84 | * &drm_info_list in the given root directory. These files will be removed |
| 85 | * automatically on drm_debugfs_cleanup(). | ||
| 85 | */ | 86 | */ |
| 86 | int drm_debugfs_create_files(const struct drm_info_list *files, int count, | 87 | int drm_debugfs_create_files(const struct drm_info_list *files, int count, |
| 87 | struct dentry *root, struct drm_minor *minor) | 88 | struct dentry *root, struct drm_minor *minor) |
| @@ -218,6 +219,19 @@ int drm_debugfs_remove_files(const struct drm_info_list *files, int count, | |||
| 218 | } | 219 | } |
| 219 | EXPORT_SYMBOL(drm_debugfs_remove_files); | 220 | EXPORT_SYMBOL(drm_debugfs_remove_files); |
| 220 | 221 | ||
| 222 | static void drm_debugfs_remove_all_files(struct drm_minor *minor) | ||
| 223 | { | ||
| 224 | struct drm_info_node *node, *tmp; | ||
| 225 | |||
| 226 | mutex_lock(&minor->debugfs_lock); | ||
| 227 | list_for_each_entry_safe(node, tmp, &minor->debugfs_list, list) { | ||
| 228 | debugfs_remove(node->dent); | ||
| 229 | list_del(&node->list); | ||
| 230 | kfree(node); | ||
| 231 | } | ||
| 232 | mutex_unlock(&minor->debugfs_lock); | ||
| 233 | } | ||
| 234 | |||
| 221 | /** | 235 | /** |
| 222 | * Cleanup the debugfs filesystem resources. | 236 | * Cleanup the debugfs filesystem resources. |
| 223 | * | 237 | * |
| @@ -229,7 +243,6 @@ EXPORT_SYMBOL(drm_debugfs_remove_files); | |||
| 229 | int drm_debugfs_cleanup(struct drm_minor *minor) | 243 | int drm_debugfs_cleanup(struct drm_minor *minor) |
| 230 | { | 244 | { |
| 231 | struct drm_device *dev = minor->dev; | 245 | struct drm_device *dev = minor->dev; |
| 232 | int ret; | ||
| 233 | 246 | ||
| 234 | if (!minor->debugfs_root) | 247 | if (!minor->debugfs_root) |
| 235 | return 0; | 248 | return 0; |
| @@ -237,17 +250,9 @@ int drm_debugfs_cleanup(struct drm_minor *minor) | |||
| 237 | if (dev->driver->debugfs_cleanup) | 250 | if (dev->driver->debugfs_cleanup) |
| 238 | dev->driver->debugfs_cleanup(minor); | 251 | dev->driver->debugfs_cleanup(minor); |
| 239 | 252 | ||
| 240 | if (drm_core_check_feature(dev, DRIVER_ATOMIC)) { | 253 | drm_debugfs_remove_all_files(minor); |
| 241 | ret = drm_atomic_debugfs_cleanup(minor); | ||
| 242 | if (ret) { | ||
| 243 | DRM_ERROR("DRM: Failed to remove atomic debugfs entries\n"); | ||
| 244 | return ret; | ||
| 245 | } | ||
| 246 | } | ||
| 247 | |||
| 248 | drm_debugfs_remove_files(drm_debugfs_list, DRM_DEBUGFS_ENTRIES, minor); | ||
| 249 | 254 | ||
| 250 | debugfs_remove(minor->debugfs_root); | 255 | debugfs_remove_recursive(minor->debugfs_root); |
| 251 | minor->debugfs_root = NULL; | 256 | minor->debugfs_root = NULL; |
| 252 | 257 | ||
| 253 | return 0; | 258 | return 0; |
diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 3e6fe82c6d64..68908c1d5ca1 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c | |||
| @@ -725,7 +725,7 @@ MODULE_PARM_DESC(dp_aux_i2c_speed_khz, | |||
| 725 | /* | 725 | /* |
| 726 | * Transfer a single I2C-over-AUX message and handle various error conditions, | 726 | * Transfer a single I2C-over-AUX message and handle various error conditions, |
| 727 | * retrying the transaction as appropriate. It is assumed that the | 727 | * retrying the transaction as appropriate. It is assumed that the |
| 728 | * aux->transfer function does not modify anything in the msg other than the | 728 | * &drm_dp_aux.transfer function does not modify anything in the msg other than the |
| 729 | * reply field. | 729 | * reply field. |
| 730 | * | 730 | * |
| 731 | * Returns bytes transferred on success, or a negative error code on failure. | 731 | * Returns bytes transferred on success, or a negative error code on failure. |
diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index aa644487749c..122a1b04bebc 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c | |||
| @@ -1086,7 +1086,7 @@ static void build_mst_prop_path(const struct drm_dp_mst_branch *mstb, | |||
| 1086 | } | 1086 | } |
| 1087 | 1087 | ||
| 1088 | static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, | 1088 | static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, |
| 1089 | struct device *dev, | 1089 | struct drm_device *dev, |
| 1090 | struct drm_dp_link_addr_reply_port *port_msg) | 1090 | struct drm_dp_link_addr_reply_port *port_msg) |
| 1091 | { | 1091 | { |
| 1092 | struct drm_dp_mst_port *port; | 1092 | struct drm_dp_mst_port *port; |
| @@ -1104,7 +1104,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch *mstb, | |||
| 1104 | port->port_num = port_msg->port_number; | 1104 | port->port_num = port_msg->port_number; |
| 1105 | port->mgr = mstb->mgr; | 1105 | port->mgr = mstb->mgr; |
| 1106 | port->aux.name = "DPMST"; | 1106 | port->aux.name = "DPMST"; |
| 1107 | port->aux.dev = dev; | 1107 | port->aux.dev = dev->dev; |
| 1108 | created = true; | 1108 | created = true; |
| 1109 | } else { | 1109 | } else { |
| 1110 | old_pdt = port->pdt; | 1110 | old_pdt = port->pdt; |
| @@ -2949,7 +2949,7 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) | |||
| 2949 | * Return 0 for success, or negative error code on failure | 2949 | * Return 0 for success, or negative error code on failure |
| 2950 | */ | 2950 | */ |
| 2951 | int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, | 2951 | int drm_dp_mst_topology_mgr_init(struct drm_dp_mst_topology_mgr *mgr, |
| 2952 | struct device *dev, struct drm_dp_aux *aux, | 2952 | struct drm_device *dev, struct drm_dp_aux *aux, |
| 2953 | int max_dpcd_transaction_bytes, | 2953 | int max_dpcd_transaction_bytes, |
| 2954 | int max_payloads, int conn_base_id) | 2954 | int max_payloads, int conn_base_id) |
| 2955 | { | 2955 | { |
diff --git a/drivers/gpu/drm/drm_drv.c b/drivers/gpu/drm/drm_drv.c index 72116978ec06..6cbd67f4fbc5 100644 --- a/drivers/gpu/drm/drm_drv.c +++ b/drivers/gpu/drm/drm_drv.c | |||
| @@ -221,7 +221,7 @@ static int drm_minor_register(struct drm_device *dev, unsigned int type) | |||
| 221 | ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); | 221 | ret = drm_debugfs_init(minor, minor->index, drm_debugfs_root); |
| 222 | if (ret) { | 222 | if (ret) { |
| 223 | DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); | 223 | DRM_ERROR("DRM: Failed to initialize /sys/kernel/debug/dri.\n"); |
| 224 | return ret; | 224 | goto err_debugfs; |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | ret = device_add(minor->kdev); | 227 | ret = device_add(minor->kdev); |
| @@ -309,7 +309,7 @@ void drm_minor_release(struct drm_minor *minor) | |||
| 309 | * userspace the device instance can be published using drm_dev_register(). | 309 | * userspace the device instance can be published using drm_dev_register(). |
| 310 | * | 310 | * |
| 311 | * There is also deprecated support for initalizing device instances using | 311 | * There is also deprecated support for initalizing device instances using |
| 312 | * bus-specific helpers and the ->load() callback. But due to | 312 | * bus-specific helpers and the &drm_driver.load callback. But due to |
| 313 | * backwards-compatibility needs the device instance have to be published too | 313 | * backwards-compatibility needs the device instance have to be published too |
| 314 | * early, which requires unpretty global locking to make safe and is therefore | 314 | * early, which requires unpretty global locking to make safe and is therefore |
| 315 | * only support for existing drivers not yet converted to the new scheme. | 315 | * only support for existing drivers not yet converted to the new scheme. |
| @@ -720,9 +720,9 @@ static void remove_compat_control_link(struct drm_device *dev) | |||
| 720 | * Never call this twice on any device! | 720 | * Never call this twice on any device! |
| 721 | * | 721 | * |
| 722 | * NOTE: To ensure backward compatibility with existing drivers method this | 722 | * NOTE: To ensure backward compatibility with existing drivers method this |
| 723 | * function calls the ->load() method after registering the device nodes, | 723 | * function calls the &drm_driver.load method after registering the device |
| 724 | * creating race conditions. Usage of the ->load() methods is therefore | 724 | * nodes, creating race conditions. Usage of the &drm_driver.load methods is |
| 725 | * deprecated, drivers must perform all initialization before calling | 725 | * therefore deprecated, drivers must perform all initialization before calling |
| 726 | * drm_dev_register(). | 726 | * drm_dev_register(). |
| 727 | * | 727 | * |
| 728 | * RETURNS: | 728 | * RETURNS: |
diff --git a/drivers/gpu/drm/drm_dumb_buffers.c b/drivers/gpu/drm/drm_dumb_buffers.c index e5c61cda4ae3..10307cc16d75 100644 --- a/drivers/gpu/drm/drm_dumb_buffers.c +++ b/drivers/gpu/drm/drm_dumb_buffers.c | |||
| @@ -42,8 +42,8 @@ | |||
| 42 | * create dumb buffers suitable for scanout, which can then be used to create | 42 | * create dumb buffers suitable for scanout, which can then be used to create |
| 43 | * KMS frame buffers. | 43 | * KMS frame buffers. |
| 44 | * | 44 | * |
| 45 | * To support dumb objects drivers must implement the dumb_create, | 45 | * To support dumb objects drivers must implement the &drm_driver.dumb_create, |
| 46 | * dumb_destroy and dumb_map_offset operations from &struct drm_driver. See | 46 | * &drm_driver.dumb_destroy and &drm_driver.dumb_map_offset operations. See |
| 47 | * there for further details. | 47 | * there for further details. |
| 48 | * | 48 | * |
| 49 | * Note that dumb objects may not be used for gpu acceleration, as has been | 49 | * Note that dumb objects may not be used for gpu acceleration, as has been |
diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 4ff04aa84dd0..baa6ccb3e18b 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c | |||
| @@ -3768,6 +3768,25 @@ bool drm_rgb_quant_range_selectable(struct edid *edid) | |||
| 3768 | } | 3768 | } |
| 3769 | EXPORT_SYMBOL(drm_rgb_quant_range_selectable); | 3769 | EXPORT_SYMBOL(drm_rgb_quant_range_selectable); |
| 3770 | 3770 | ||
| 3771 | /** | ||
| 3772 | * drm_default_rgb_quant_range - default RGB quantization range | ||
| 3773 | * @mode: display mode | ||
| 3774 | * | ||
| 3775 | * Determine the default RGB quantization range for the mode, | ||
| 3776 | * as specified in CEA-861. | ||
| 3777 | * | ||
| 3778 | * Return: The default RGB quantization range for the mode | ||
| 3779 | */ | ||
| 3780 | enum hdmi_quantization_range | ||
| 3781 | drm_default_rgb_quant_range(const struct drm_display_mode *mode) | ||
| 3782 | { | ||
| 3783 | /* All CEA modes other than VIC 1 use limited quantization range. */ | ||
| 3784 | return drm_match_cea_mode(mode) > 1 ? | ||
| 3785 | HDMI_QUANTIZATION_RANGE_LIMITED : | ||
| 3786 | HDMI_QUANTIZATION_RANGE_FULL; | ||
| 3787 | } | ||
| 3788 | EXPORT_SYMBOL(drm_default_rgb_quant_range); | ||
| 3789 | |||
| 3771 | static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, | 3790 | static void drm_parse_hdmi_deep_color_info(struct drm_connector *connector, |
| 3772 | const u8 *hdmi) | 3791 | const u8 *hdmi) |
| 3773 | { | 3792 | { |
| @@ -4273,6 +4292,52 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, | |||
| 4273 | } | 4292 | } |
| 4274 | EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode); | 4293 | EXPORT_SYMBOL(drm_hdmi_avi_infoframe_from_display_mode); |
| 4275 | 4294 | ||
| 4295 | /** | ||
| 4296 | * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe | ||
| 4297 | * quantization range information | ||
| 4298 | * @frame: HDMI AVI infoframe | ||
| 4299 | * @mode: DRM display mode | ||
| 4300 | * @rgb_quant_range: RGB quantization range (Q) | ||
| 4301 | * @rgb_quant_range_selectable: Sink support selectable RGB quantization range (QS) | ||
| 4302 | */ | ||
| 4303 | void | ||
| 4304 | drm_hdmi_avi_infoframe_quant_range(struct hdmi_avi_infoframe *frame, | ||
| 4305 | const struct drm_display_mode *mode, | ||
| 4306 | enum hdmi_quantization_range rgb_quant_range, | ||
| 4307 | bool rgb_quant_range_selectable) | ||
| 4308 | { | ||
| 4309 | /* | ||
| 4310 | * CEA-861: | ||
| 4311 | * "A Source shall not send a non-zero Q value that does not correspond | ||
| 4312 | * to the default RGB Quantization Range for the transmitted Picture | ||
| 4313 | * unless the Sink indicates support for the Q bit in a Video | ||
| 4314 | * Capabilities Data Block." | ||
| 4315 | * | ||
| 4316 | * HDMI 2.0 recommends sending non-zero Q when it does match the | ||
| 4317 | * default RGB quantization range for the mode, even when QS=0. | ||
| 4318 | */ | ||
| 4319 | if (rgb_quant_range_selectable || | ||
| 4320 | rgb_quant_range == drm_default_rgb_quant_range(mode)) | ||
| 4321 | frame->quantization_range = rgb_quant_range; | ||
| 4322 | else | ||
| 4323 | frame->quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; | ||
| 4324 | |||
| 4325 | /* | ||
| 4326 | * CEA-861-F: | ||
| 4327 | * "When transmitting any RGB colorimetry, the Source should set the | ||
| 4328 | * YQ-field to match the RGB Quantization Range being transmitted | ||
| 4329 | * (e.g., when Limited Range RGB, set YQ=0 or when Full Range RGB, | ||
| 4330 | * set YQ=1) and the Sink shall ignore the YQ-field." | ||
| 4331 | */ | ||
| 4332 | if (rgb_quant_range == HDMI_QUANTIZATION_RANGE_LIMITED) | ||
| 4333 | frame->ycc_quantization_range = | ||
| 4334 | HDMI_YCC_QUANTIZATION_RANGE_LIMITED; | ||
| 4335 | else | ||
| 4336 | frame->ycc_quantization_range = | ||
| 4337 | HDMI_YCC_QUANTIZATION_RANGE_FULL; | ||
| 4338 | } | ||
| 4339 | EXPORT_SYMBOL(drm_hdmi_avi_infoframe_quant_range); | ||
| 4340 | |||
| 4276 | static enum hdmi_3d_structure | 4341 | static enum hdmi_3d_structure |
| 4277 | s3d_structure_from_display_mode(const struct drm_display_mode *mode) | 4342 | s3d_structure_from_display_mode(const struct drm_display_mode *mode) |
| 4278 | { | 4343 | { |
diff --git a/drivers/gpu/drm/drm_encoder.c b/drivers/gpu/drm/drm_encoder.c index 487cfe3989e8..129450713bb7 100644 --- a/drivers/gpu/drm/drm_encoder.c +++ b/drivers/gpu/drm/drm_encoder.c | |||
| @@ -98,7 +98,7 @@ void drm_encoder_unregister_all(struct drm_device *dev) | |||
| 98 | * | 98 | * |
| 99 | * Initialises a preallocated encoder. Encoder should be subclassed as part of | 99 | * Initialises a preallocated encoder. Encoder should be subclassed as part of |
| 100 | * driver encoder objects. At driver unload time drm_encoder_cleanup() should be | 100 | * driver encoder objects. At driver unload time drm_encoder_cleanup() should be |
| 101 | * called from the driver's destroy hook in &drm_encoder_funcs. | 101 | * called from the driver's &drm_encoder_funcs.destroy hook. |
| 102 | * | 102 | * |
| 103 | * Returns: | 103 | * Returns: |
| 104 | * Zero on success, error code on failure. | 104 | * Zero on success, error code on failure. |
diff --git a/drivers/gpu/drm/drm_encoder_slave.c b/drivers/gpu/drm/drm_encoder_slave.c index 4484785cd9ac..cf804389f5ec 100644 --- a/drivers/gpu/drm/drm_encoder_slave.c +++ b/drivers/gpu/drm/drm_encoder_slave.c | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | * &drm_encoder_slave. The @slave_funcs field will be initialized with | 43 | * &drm_encoder_slave. The @slave_funcs field will be initialized with |
| 44 | * the hooks provided by the slave driver. | 44 | * the hooks provided by the slave driver. |
| 45 | * | 45 | * |
| 46 | * If @info->platform_data is non-NULL it will be used as the initial | 46 | * If @info.platform_data is non-NULL it will be used as the initial |
| 47 | * slave config. | 47 | * slave config. |
| 48 | * | 48 | * |
| 49 | * Returns 0 on success or a negative errno on failure, in particular, | 49 | * Returns 0 on success or a negative errno on failure, in particular, |
diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 4364abfb6a71..0ef8b284a4b8 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c | |||
| @@ -622,3 +622,21 @@ void drm_fbdev_cma_set_suspend(struct drm_fbdev_cma *fbdev_cma, int state) | |||
| 622 | drm_fb_helper_set_suspend(&fbdev_cma->fb_helper, state); | 622 | drm_fb_helper_set_suspend(&fbdev_cma->fb_helper, state); |
| 623 | } | 623 | } |
| 624 | EXPORT_SYMBOL(drm_fbdev_cma_set_suspend); | 624 | EXPORT_SYMBOL(drm_fbdev_cma_set_suspend); |
| 625 | |||
| 626 | /** | ||
| 627 | * drm_fbdev_cma_set_suspend_unlocked - wrapper around | ||
| 628 | * drm_fb_helper_set_suspend_unlocked | ||
| 629 | * @fbdev_cma: The drm_fbdev_cma struct, may be NULL | ||
| 630 | * @state: desired state, zero to resume, non-zero to suspend | ||
| 631 | * | ||
| 632 | * Calls drm_fb_helper_set_suspend, which is a wrapper around | ||
| 633 | * fb_set_suspend implemented by fbdev core. | ||
| 634 | */ | ||
| 635 | void drm_fbdev_cma_set_suspend_unlocked(struct drm_fbdev_cma *fbdev_cma, | ||
| 636 | int state) | ||
| 637 | { | ||
| 638 | if (fbdev_cma) | ||
| 639 | drm_fb_helper_set_suspend_unlocked(&fbdev_cma->fb_helper, | ||
| 640 | state); | ||
| 641 | } | ||
| 642 | EXPORT_SYMBOL(drm_fbdev_cma_set_suspend_unlocked); | ||
diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index 0ab6aaacb7d6..c7fafa175755 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c | |||
| @@ -66,11 +66,11 @@ static DEFINE_MUTEX(kernel_fb_helper_lock); | |||
| 66 | * Teardown is done with drm_fb_helper_fini(). | 66 | * Teardown is done with drm_fb_helper_fini(). |
| 67 | * | 67 | * |
| 68 | * At runtime drivers should restore the fbdev console by calling | 68 | * At runtime drivers should restore the fbdev console by calling |
| 69 | * drm_fb_helper_restore_fbdev_mode_unlocked() from their ->lastclose callback. | 69 | * drm_fb_helper_restore_fbdev_mode_unlocked() from their &drm_driver.lastclose |
| 70 | * They should also notify the fb helper code from updates to the output | 70 | * callback. They should also notify the fb helper code from updates to the |
| 71 | * configuration by calling drm_fb_helper_hotplug_event(). For easier | 71 | * output configuration by calling drm_fb_helper_hotplug_event(). For easier |
| 72 | * integration with the output polling code in drm_crtc_helper.c the modeset | 72 | * integration with the output polling code in drm_crtc_helper.c the modeset |
| 73 | * code provides a ->output_poll_changed callback. | 73 | * code provides a &drm_mode_config_funcs.output_poll_changed callback. |
| 74 | * | 74 | * |
| 75 | * All other functions exported by the fb helper library can be used to | 75 | * All other functions exported by the fb helper library can be used to |
| 76 | * implement the fbdev driver interface by the driver. | 76 | * implement the fbdev driver interface by the driver. |
| @@ -79,7 +79,7 @@ static DEFINE_MUTEX(kernel_fb_helper_lock); | |||
| 79 | * hotplug detection using the fbdev helpers. The drm_fb_helper_prepare() | 79 | * hotplug detection using the fbdev helpers. The drm_fb_helper_prepare() |
| 80 | * helper must be called first to initialize the minimum required to make | 80 | * helper must be called first to initialize the minimum required to make |
| 81 | * hotplug detection work. Drivers also need to make sure to properly set up | 81 | * hotplug detection work. Drivers also need to make sure to properly set up |
| 82 | * the dev->mode_config.funcs member. After calling drm_kms_helper_poll_init() | 82 | * the &drm_mode_config.funcs member. After calling drm_kms_helper_poll_init() |
| 83 | * it is safe to enable interrupts and start processing hotplug events. At the | 83 | * it is safe to enable interrupts and start processing hotplug events. At the |
| 84 | * same time, drivers should initialize all modeset objects such as CRTCs, | 84 | * same time, drivers should initialize all modeset objects such as CRTCs, |
| 85 | * encoders and connectors. To finish up the fbdev helper initialization, the | 85 | * encoders and connectors. To finish up the fbdev helper initialization, the |
| @@ -88,9 +88,9 @@ static DEFINE_MUTEX(kernel_fb_helper_lock); | |||
| 88 | * should call drm_fb_helper_single_add_all_connectors() followed by | 88 | * should call drm_fb_helper_single_add_all_connectors() followed by |
| 89 | * drm_fb_helper_initial_config(). | 89 | * drm_fb_helper_initial_config(). |
| 90 | * | 90 | * |
| 91 | * If &drm_framebuffer_funcs ->dirty is set, the | 91 | * If &drm_framebuffer_funcs.dirty is set, the |
| 92 | * drm_fb_helper_{cfb,sys}_{write,fillrect,copyarea,imageblit} functions will | 92 | * drm_fb_helper_{cfb,sys}_{write,fillrect,copyarea,imageblit} functions will |
| 93 | * accumulate changes and schedule &drm_fb_helper ->dirty_work to run right | 93 | * accumulate changes and schedule &drm_fb_helper.dirty_work to run right |
| 94 | * away. This worker then calls the dirty() function ensuring that it will | 94 | * away. This worker then calls the dirty() function ensuring that it will |
| 95 | * always run in process context since the fb_*() function could be running in | 95 | * always run in process context since the fb_*() function could be running in |
| 96 | * atomic context. If drm_fb_helper_deferred_io() is used as the deferred_io | 96 | * atomic context. If drm_fb_helper_deferred_io() is used as the deferred_io |
| @@ -247,7 +247,7 @@ static void drm_fb_helper_restore_lut_atomic(struct drm_crtc *crtc) | |||
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | /** | 249 | /** |
| 250 | * drm_fb_helper_debug_enter - implementation for ->fb_debug_enter | 250 | * drm_fb_helper_debug_enter - implementation for &fb_ops.fb_debug_enter |
| 251 | * @info: fbdev registered by the helper | 251 | * @info: fbdev registered by the helper |
| 252 | */ | 252 | */ |
| 253 | int drm_fb_helper_debug_enter(struct fb_info *info) | 253 | int drm_fb_helper_debug_enter(struct fb_info *info) |
| @@ -296,7 +296,7 @@ static struct drm_framebuffer *drm_mode_config_fb(struct drm_crtc *crtc) | |||
| 296 | } | 296 | } |
| 297 | 297 | ||
| 298 | /** | 298 | /** |
| 299 | * drm_fb_helper_debug_leave - implementation for ->fb_debug_leave | 299 | * drm_fb_helper_debug_leave - implementation for &fb_ops.fb_debug_leave |
| 300 | * @info: fbdev registered by the helper | 300 | * @info: fbdev registered by the helper |
| 301 | */ | 301 | */ |
| 302 | int drm_fb_helper_debug_leave(struct fb_info *info) | 302 | int drm_fb_helper_debug_leave(struct fb_info *info) |
| @@ -445,7 +445,7 @@ static int restore_fbdev_mode(struct drm_fb_helper *fb_helper) | |||
| 445 | * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration | 445 | * drm_fb_helper_restore_fbdev_mode_unlocked - restore fbdev configuration |
| 446 | * @fb_helper: fbcon to restore | 446 | * @fb_helper: fbcon to restore |
| 447 | * | 447 | * |
| 448 | * This should be called from driver's drm ->lastclose callback | 448 | * This should be called from driver's drm &drm_driver.lastclose callback |
| 449 | * when implementing an fbcon on top of kms using this helper. This ensures that | 449 | * when implementing an fbcon on top of kms using this helper. This ensures that |
| 450 | * the user isn't greeted with a black screen when e.g. X dies. | 450 | * the user isn't greeted with a black screen when e.g. X dies. |
| 451 | * | 451 | * |
| @@ -585,7 +585,7 @@ static void drm_fb_helper_dpms(struct fb_info *info, int dpms_mode) | |||
| 585 | } | 585 | } |
| 586 | 586 | ||
| 587 | /** | 587 | /** |
| 588 | * drm_fb_helper_blank - implementation for ->fb_blank | 588 | * drm_fb_helper_blank - implementation for &fb_ops.fb_blank |
| 589 | * @blank: desired blanking state | 589 | * @blank: desired blanking state |
| 590 | * @info: fbdev registered by the helper | 590 | * @info: fbdev registered by the helper |
| 591 | */ | 591 | */ |
| @@ -912,7 +912,7 @@ static void drm_fb_helper_dirty(struct fb_info *info, u32 x, u32 y, | |||
| 912 | * @info: fb_info struct pointer | 912 | * @info: fb_info struct pointer |
| 913 | * @pagelist: list of dirty mmap framebuffer pages | 913 | * @pagelist: list of dirty mmap framebuffer pages |
| 914 | * | 914 | * |
| 915 | * This function is used as the &fb_deferred_io ->deferred_io | 915 | * This function is used as the &fb_deferred_io.deferred_io |
| 916 | * callback function for flushing the fbdev mmap writes. | 916 | * callback function for flushing the fbdev mmap writes. |
| 917 | */ | 917 | */ |
| 918 | void drm_fb_helper_deferred_io(struct fb_info *info, | 918 | void drm_fb_helper_deferred_io(struct fb_info *info, |
| @@ -1103,7 +1103,7 @@ EXPORT_SYMBOL(drm_fb_helper_set_suspend); | |||
| 1103 | * due to all the printk activity. | 1103 | * due to all the printk activity. |
| 1104 | * | 1104 | * |
| 1105 | * This function can be called multiple times with the same state since | 1105 | * This function can be called multiple times with the same state since |
| 1106 | * &fb_info->state is checked to see if fbdev is running or not before locking. | 1106 | * &fb_info.state is checked to see if fbdev is running or not before locking. |
| 1107 | * | 1107 | * |
| 1108 | * Use drm_fb_helper_set_suspend() if you need to take the lock yourself. | 1108 | * Use drm_fb_helper_set_suspend() if you need to take the lock yourself. |
| 1109 | */ | 1109 | */ |
| @@ -1181,7 +1181,7 @@ static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green, | |||
| 1181 | } | 1181 | } |
| 1182 | 1182 | ||
| 1183 | /** | 1183 | /** |
| 1184 | * drm_fb_helper_setcmap - implementation for ->fb_setcmap | 1184 | * drm_fb_helper_setcmap - implementation for &fb_ops.fb_setcmap |
| 1185 | * @cmap: cmap to set | 1185 | * @cmap: cmap to set |
| 1186 | * @info: fbdev registered by the helper | 1186 | * @info: fbdev registered by the helper |
| 1187 | */ | 1187 | */ |
| @@ -1238,7 +1238,7 @@ int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info) | |||
| 1238 | EXPORT_SYMBOL(drm_fb_helper_setcmap); | 1238 | EXPORT_SYMBOL(drm_fb_helper_setcmap); |
| 1239 | 1239 | ||
| 1240 | /** | 1240 | /** |
| 1241 | * drm_fb_helper_check_var - implementation for ->fb_check_var | 1241 | * drm_fb_helper_check_var - implementation for &fb_ops.fb_check_var |
| 1242 | * @var: screeninfo to check | 1242 | * @var: screeninfo to check |
| 1243 | * @info: fbdev registered by the helper | 1243 | * @info: fbdev registered by the helper |
| 1244 | */ | 1244 | */ |
| @@ -1338,7 +1338,7 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, | |||
| 1338 | EXPORT_SYMBOL(drm_fb_helper_check_var); | 1338 | EXPORT_SYMBOL(drm_fb_helper_check_var); |
| 1339 | 1339 | ||
| 1340 | /** | 1340 | /** |
| 1341 | * drm_fb_helper_set_par - implementation for ->fb_set_par | 1341 | * drm_fb_helper_set_par - implementation for &fb_ops.fb_set_par |
| 1342 | * @info: fbdev registered by the helper | 1342 | * @info: fbdev registered by the helper |
| 1343 | * | 1343 | * |
| 1344 | * This will let fbcon do the mode init and is called at initialization time by | 1344 | * This will let fbcon do the mode init and is called at initialization time by |
| @@ -1422,7 +1422,7 @@ backoff: | |||
| 1422 | } | 1422 | } |
| 1423 | 1423 | ||
| 1424 | /** | 1424 | /** |
| 1425 | * drm_fb_helper_pan_display - implementation for ->fb_pan_display | 1425 | * drm_fb_helper_pan_display - implementation for &fb_ops.fb_pan_display |
| 1426 | * @var: updated screen information | 1426 | * @var: updated screen information |
| 1427 | * @info: fbdev registered by the helper | 1427 | * @info: fbdev registered by the helper |
| 1428 | */ | 1428 | */ |
| @@ -1607,7 +1607,7 @@ static int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper, | |||
| 1607 | * additional constraints need to set up their own limits. | 1607 | * additional constraints need to set up their own limits. |
| 1608 | * | 1608 | * |
| 1609 | * Drivers should call this (or their equivalent setup code) from their | 1609 | * Drivers should call this (or their equivalent setup code) from their |
| 1610 | * ->fb_probe callback. | 1610 | * &drm_fb_helper_funcs.fb_probe callback. |
| 1611 | */ | 1611 | */ |
| 1612 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, | 1612 | void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch, |
| 1613 | uint32_t depth) | 1613 | uint32_t depth) |
| @@ -1636,11 +1636,11 @@ EXPORT_SYMBOL(drm_fb_helper_fill_fix); | |||
| 1636 | * @fb_height: desired fb height | 1636 | * @fb_height: desired fb height |
| 1637 | * | 1637 | * |
| 1638 | * Sets up the variable fbdev metainformation from the given fb helper instance | 1638 | * Sets up the variable fbdev metainformation from the given fb helper instance |
| 1639 | * and the drm framebuffer allocated in fb_helper->fb. | 1639 | * and the drm framebuffer allocated in &drm_fb_helper.fb. |
| 1640 | * | 1640 | * |
| 1641 | * Drivers should call this (or their equivalent setup code) from their | 1641 | * Drivers should call this (or their equivalent setup code) from their |
| 1642 | * ->fb_probe callback after having allocated the fbdev backing | 1642 | * &drm_fb_helper_funcs.fb_probe callback after having allocated the fbdev |
| 1643 | * storage framebuffer. | 1643 | * backing storage framebuffer. |
| 1644 | */ | 1644 | */ |
| 1645 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, | 1645 | void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper, |
| 1646 | uint32_t fb_width, uint32_t fb_height) | 1646 | uint32_t fb_width, uint32_t fb_height) |
| @@ -2207,9 +2207,9 @@ out: | |||
| 2207 | * Note that this also registers the fbdev and so allows userspace to call into | 2207 | * Note that this also registers the fbdev and so allows userspace to call into |
| 2208 | * the driver through the fbdev interfaces. | 2208 | * the driver through the fbdev interfaces. |
| 2209 | * | 2209 | * |
| 2210 | * This function will call down into the ->fb_probe callback to let | 2210 | * This function will call down into the &drm_fb_helper_funcs.fb_probe callback |
| 2211 | * the driver allocate and initialize the fbdev info structure and the drm | 2211 | * to let the driver allocate and initialize the fbdev info structure and the |
| 2212 | * framebuffer used to back the fbdev. drm_fb_helper_fill_var() and | 2212 | * drm framebuffer used to back the fbdev. drm_fb_helper_fill_var() and |
| 2213 | * drm_fb_helper_fill_fix() are provided as helpers to setup simple default | 2213 | * drm_fb_helper_fill_fix() are provided as helpers to setup simple default |
| 2214 | * values for the fbdev info structure. | 2214 | * values for the fbdev info structure. |
| 2215 | * | 2215 | * |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index e22645375e60..afdf5b147f39 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
| @@ -580,7 +580,7 @@ EXPORT_SYMBOL(drm_poll); | |||
| 580 | * kmalloc and @p must be the first member element. | 580 | * kmalloc and @p must be the first member element. |
| 581 | * | 581 | * |
| 582 | * This is the locked version of drm_event_reserve_init() for callers which | 582 | * This is the locked version of drm_event_reserve_init() for callers which |
| 583 | * already hold dev->event_lock. | 583 | * already hold &drm_device.event_lock. |
| 584 | * | 584 | * |
| 585 | * RETURNS: | 585 | * RETURNS: |
| 586 | * | 586 | * |
| @@ -621,7 +621,7 @@ EXPORT_SYMBOL(drm_event_reserve_init_locked); | |||
| 621 | * If callers embedded @p into a larger structure it must be allocated with | 621 | * If callers embedded @p into a larger structure it must be allocated with |
| 622 | * kmalloc and @p must be the first member element. | 622 | * kmalloc and @p must be the first member element. |
| 623 | * | 623 | * |
| 624 | * Callers which already hold dev->event_lock should use | 624 | * Callers which already hold &drm_device.event_lock should use |
| 625 | * drm_event_reserve_init_locked() instead. | 625 | * drm_event_reserve_init_locked() instead. |
| 626 | * | 626 | * |
| 627 | * RETURNS: | 627 | * RETURNS: |
| @@ -677,7 +677,7 @@ EXPORT_SYMBOL(drm_event_cancel_free); | |||
| 677 | * | 677 | * |
| 678 | * This function sends the event @e, initialized with drm_event_reserve_init(), | 678 | * This function sends the event @e, initialized with drm_event_reserve_init(), |
| 679 | * to its associated userspace DRM file. Callers must already hold | 679 | * to its associated userspace DRM file. Callers must already hold |
| 680 | * dev->event_lock, see drm_send_event() for the unlocked version. | 680 | * &drm_device.event_lock, see drm_send_event() for the unlocked version. |
| 681 | * | 681 | * |
| 682 | * Note that the core will take care of unlinking and disarming events when the | 682 | * Note that the core will take care of unlinking and disarming events when the |
| 683 | * corresponding DRM file is closed. Drivers need not worry about whether the | 683 | * corresponding DRM file is closed. Drivers need not worry about whether the |
| @@ -717,8 +717,9 @@ EXPORT_SYMBOL(drm_send_event_locked); | |||
| 717 | * @e: DRM event to deliver | 717 | * @e: DRM event to deliver |
| 718 | * | 718 | * |
| 719 | * This function sends the event @e, initialized with drm_event_reserve_init(), | 719 | * This function sends the event @e, initialized with drm_event_reserve_init(), |
| 720 | * to its associated userspace DRM file. This function acquires dev->event_lock, | 720 | * to its associated userspace DRM file. This function acquires |
| 721 | * see drm_send_event_locked() for callers which already hold this lock. | 721 | * &drm_device.event_lock, see drm_send_event_locked() for callers which already |
| 722 | * hold this lock. | ||
| 722 | * | 723 | * |
| 723 | * Note that the core will take care of unlinking and disarming events when the | 724 | * Note that the core will take care of unlinking and disarming events when the |
| 724 | * corresponding DRM file is closed. Drivers need not worry about whether the | 725 | * corresponding DRM file is closed. Drivers need not worry about whether the |
diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 588ccc3a2218..28a0108a1ab8 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c | |||
| @@ -58,8 +58,8 @@ | |||
| 58 | * fbdev framebuffer when the struct &struct drm_framebuffer is embedded into | 58 | * fbdev framebuffer when the struct &struct drm_framebuffer is embedded into |
| 59 | * the fbdev helper struct) drivers can manually clean up a framebuffer at | 59 | * the fbdev helper struct) drivers can manually clean up a framebuffer at |
| 60 | * module unload time with drm_framebuffer_unregister_private(). But doing this | 60 | * module unload time with drm_framebuffer_unregister_private(). But doing this |
| 61 | * is not recommended, and it's better to have a normal free-standing struct | 61 | * is not recommended, and it's better to have a normal free-standing &struct |
| 62 | * &drm_framebuffer. | 62 | * drm_framebuffer. |
| 63 | */ | 63 | */ |
| 64 | 64 | ||
| 65 | int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y, | 65 | int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y, |
| @@ -470,7 +470,7 @@ int drm_mode_getfb(struct drm_device *dev, | |||
| 470 | * usb display-link, mipi manual update panels or edp panel self refresh modes. | 470 | * usb display-link, mipi manual update panels or edp panel self refresh modes. |
| 471 | * | 471 | * |
| 472 | * Modesetting drivers which always update the frontbuffer do not need to | 472 | * Modesetting drivers which always update the frontbuffer do not need to |
| 473 | * implement the corresponding ->dirty framebuffer callback. | 473 | * implement the corresponding &drm_framebuffer_funcs.dirty callback. |
| 474 | * | 474 | * |
| 475 | * Called by the user via ioctl. | 475 | * Called by the user via ioctl. |
| 476 | * | 476 | * |
| @@ -709,10 +709,10 @@ EXPORT_SYMBOL(drm_framebuffer_unregister_private); | |||
| 709 | * @fb: framebuffer to remove | 709 | * @fb: framebuffer to remove |
| 710 | * | 710 | * |
| 711 | * Cleanup framebuffer. This function is intended to be used from the drivers | 711 | * Cleanup framebuffer. This function is intended to be used from the drivers |
| 712 | * ->destroy callback. It can also be used to clean up driver private | 712 | * &drm_framebuffer_funcs.destroy callback. It can also be used to clean up |
| 713 | * framebuffers embedded into a larger structure. | 713 | * driver private framebuffers embedded into a larger structure. |
| 714 | * | 714 | * |
| 715 | * Note that this function does not remove the fb from active usuage - if it is | 715 | * Note that this function does not remove the fb from active usage - if it is |
| 716 | * still used anywhere, hilarity can ensue since userspace could call getfb on | 716 | * still used anywhere, hilarity can ensue since userspace could call getfb on |
| 717 | * the id and get back -EINVAL. Obviously no concern at driver unload time. | 717 | * the id and get back -EINVAL. Obviously no concern at driver unload time. |
| 718 | * | 718 | * |
diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c index 465bacd0a630..bc93de308673 100644 --- a/drivers/gpu/drm/drm_gem.c +++ b/drivers/gpu/drm/drm_gem.c | |||
| @@ -316,8 +316,8 @@ EXPORT_SYMBOL(drm_gem_handle_delete); | |||
| 316 | * @dev: corresponding drm_device | 316 | * @dev: corresponding drm_device |
| 317 | * @handle: the dumb handle to remove | 317 | * @handle: the dumb handle to remove |
| 318 | * | 318 | * |
| 319 | * This implements the ->dumb_destroy kms driver callback for drivers which use | 319 | * This implements the &drm_driver.dumb_destroy kms driver callback for drivers |
| 320 | * gem to manage their backing storage. | 320 | * which use gem to manage their backing storage. |
| 321 | */ | 321 | */ |
| 322 | int drm_gem_dumb_destroy(struct drm_file *file, | 322 | int drm_gem_dumb_destroy(struct drm_file *file, |
| 323 | struct drm_device *dev, | 323 | struct drm_device *dev, |
| @@ -333,9 +333,9 @@ EXPORT_SYMBOL(drm_gem_dumb_destroy); | |||
| 333 | * @obj: object to register | 333 | * @obj: object to register |
| 334 | * @handlep: pointer to return the created handle to the caller | 334 | * @handlep: pointer to return the created handle to the caller |
| 335 | * | 335 | * |
| 336 | * This expects the dev->object_name_lock to be held already and will drop it | 336 | * This expects the &drm_device.object_name_lock to be held already and will |
| 337 | * before returning. Used to avoid races in establishing new handles when | 337 | * drop it before returning. Used to avoid races in establishing new handles |
| 338 | * importing an object from either an flink name or a dma-buf. | 338 | * when importing an object from either an flink name or a dma-buf. |
| 339 | * | 339 | * |
| 340 | * Handles must be release again through drm_gem_handle_delete(). This is done | 340 | * Handles must be release again through drm_gem_handle_delete(). This is done |
| 341 | * when userspace closes @file_priv for all attached handles, or through the | 341 | * when userspace closes @file_priv for all attached handles, or through the |
| @@ -447,8 +447,8 @@ EXPORT_SYMBOL(drm_gem_free_mmap_offset); | |||
| 447 | * structures. | 447 | * structures. |
| 448 | * | 448 | * |
| 449 | * This routine allocates and attaches a fake offset for @obj, in cases where | 449 | * This routine allocates and attaches a fake offset for @obj, in cases where |
| 450 | * the virtual size differs from the physical size (ie. obj->size). Otherwise | 450 | * the virtual size differs from the physical size (ie. &drm_gem_object.size). |
| 451 | * just use drm_gem_create_mmap_offset(). | 451 | * Otherwise just use drm_gem_create_mmap_offset(). |
| 452 | * | 452 | * |
| 453 | * This function is idempotent and handles an already allocated mmap offset | 453 | * This function is idempotent and handles an already allocated mmap offset |
| 454 | * transparently. Drivers do not need to check for this case. | 454 | * transparently. Drivers do not need to check for this case. |
| @@ -787,7 +787,7 @@ EXPORT_SYMBOL(drm_gem_object_release); | |||
| 787 | * @kref: kref of the object to free | 787 | * @kref: kref of the object to free |
| 788 | * | 788 | * |
| 789 | * Called after the last reference to the object has been lost. | 789 | * Called after the last reference to the object has been lost. |
| 790 | * Must be called holding &drm_device->struct_mutex. | 790 | * Must be called holding &drm_device.struct_mutex. |
| 791 | * | 791 | * |
| 792 | * Frees the object | 792 | * Frees the object |
| 793 | */ | 793 | */ |
| @@ -813,7 +813,7 @@ EXPORT_SYMBOL(drm_gem_object_free); | |||
| 813 | * @obj: GEM buffer object | 813 | * @obj: GEM buffer object |
| 814 | * | 814 | * |
| 815 | * This releases a reference to @obj. Callers must not hold the | 815 | * This releases a reference to @obj. Callers must not hold the |
| 816 | * dev->struct_mutex lock when calling this function. | 816 | * &drm_device.struct_mutex lock when calling this function. |
| 817 | * | 817 | * |
| 818 | * See also __drm_gem_object_unreference(). | 818 | * See also __drm_gem_object_unreference(). |
| 819 | */ | 819 | */ |
| @@ -840,9 +840,9 @@ EXPORT_SYMBOL(drm_gem_object_unreference_unlocked); | |||
| 840 | * drm_gem_object_unreference - release a GEM BO reference | 840 | * drm_gem_object_unreference - release a GEM BO reference |
| 841 | * @obj: GEM buffer object | 841 | * @obj: GEM buffer object |
| 842 | * | 842 | * |
| 843 | * This releases a reference to @obj. Callers must hold the dev->struct_mutex | 843 | * This releases a reference to @obj. Callers must hold the |
| 844 | * lock when calling this function, even when the driver doesn't use | 844 | * &drm_device.struct_mutex lock when calling this function, even when the |
| 845 | * dev->struct_mutex for anything. | 845 | * driver doesn't use &drm_device.struct_mutex for anything. |
| 846 | * | 846 | * |
| 847 | * For drivers not encumbered with legacy locking use | 847 | * For drivers not encumbered with legacy locking use |
| 848 | * drm_gem_object_unreference_unlocked() instead. | 848 | * drm_gem_object_unreference_unlocked() instead. |
diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h index a6213f814345..f37388cb2fde 100644 --- a/drivers/gpu/drm/drm_internal.h +++ b/drivers/gpu/drm/drm_internal.h | |||
| @@ -31,6 +31,7 @@ void drm_lastclose(struct drm_device *dev); | |||
| 31 | /* drm_pci.c */ | 31 | /* drm_pci.c */ |
| 32 | int drm_irq_by_busid(struct drm_device *dev, void *data, | 32 | int drm_irq_by_busid(struct drm_device *dev, void *data, |
| 33 | struct drm_file *file_priv); | 33 | struct drm_file *file_priv); |
| 34 | void drm_pci_agp_destroy(struct drm_device *dev); | ||
| 34 | 35 | ||
| 35 | /* drm_prime.c */ | 36 | /* drm_prime.c */ |
| 36 | int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, | 37 | int drm_prime_handle_to_fd_ioctl(struct drm_device *dev, void *data, |
diff --git a/drivers/gpu/drm/drm_irq.c b/drivers/gpu/drm/drm_irq.c index 88c69e71102e..e06cf11ebb4a 100644 --- a/drivers/gpu/drm/drm_irq.c +++ b/drivers/gpu/drm/drm_irq.c | |||
| @@ -95,7 +95,7 @@ static void store_vblank(struct drm_device *dev, unsigned int pipe, | |||
| 95 | * | 95 | * |
| 96 | * Only to be called from drm_crtc_vblank_on(). | 96 | * Only to be called from drm_crtc_vblank_on(). |
| 97 | * | 97 | * |
| 98 | * Note: caller must hold dev->vbl_lock since this reads & writes | 98 | * Note: caller must hold &drm_device.vbl_lock since this reads & writes |
| 99 | * device vblank fields. | 99 | * device vblank fields. |
| 100 | */ | 100 | */ |
| 101 | static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe) | 101 | static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe) |
| @@ -142,7 +142,7 @@ static void drm_reset_vblank_timestamp(struct drm_device *dev, unsigned int pipe | |||
| 142 | * Only necessary when going from off->on, to account for frames we | 142 | * Only necessary when going from off->on, to account for frames we |
| 143 | * didn't get an interrupt for. | 143 | * didn't get an interrupt for. |
| 144 | * | 144 | * |
| 145 | * Note: caller must hold dev->vbl_lock since this reads & writes | 145 | * Note: caller must hold &drm_device.vbl_lock since this reads & writes |
| 146 | * device vblank fields. | 146 | * device vblank fields. |
| 147 | */ | 147 | */ |
| 148 | static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, | 148 | static void drm_update_vblank_count(struct drm_device *dev, unsigned int pipe, |
| @@ -415,29 +415,6 @@ err: | |||
| 415 | } | 415 | } |
| 416 | EXPORT_SYMBOL(drm_vblank_init); | 416 | EXPORT_SYMBOL(drm_vblank_init); |
| 417 | 417 | ||
| 418 | static void drm_irq_vgaarb_nokms(void *cookie, bool state) | ||
| 419 | { | ||
| 420 | struct drm_device *dev = cookie; | ||
| 421 | |||
| 422 | if (dev->driver->vgaarb_irq) { | ||
| 423 | dev->driver->vgaarb_irq(dev, state); | ||
| 424 | return; | ||
| 425 | } | ||
| 426 | |||
| 427 | if (!dev->irq_enabled) | ||
| 428 | return; | ||
| 429 | |||
| 430 | if (state) { | ||
| 431 | if (dev->driver->irq_uninstall) | ||
| 432 | dev->driver->irq_uninstall(dev); | ||
| 433 | } else { | ||
| 434 | if (dev->driver->irq_preinstall) | ||
| 435 | dev->driver->irq_preinstall(dev); | ||
| 436 | if (dev->driver->irq_postinstall) | ||
| 437 | dev->driver->irq_postinstall(dev); | ||
| 438 | } | ||
| 439 | } | ||
| 440 | |||
| 441 | /** | 418 | /** |
| 442 | * drm_irq_install - install IRQ handler | 419 | * drm_irq_install - install IRQ handler |
| 443 | * @dev: DRM device | 420 | * @dev: DRM device |
| @@ -449,7 +426,7 @@ static void drm_irq_vgaarb_nokms(void *cookie, bool state) | |||
| 449 | * | 426 | * |
| 450 | * This is the simplified helper interface provided for drivers with no special | 427 | * This is the simplified helper interface provided for drivers with no special |
| 451 | * needs. Drivers which need to install interrupt handlers for multiple | 428 | * needs. Drivers which need to install interrupt handlers for multiple |
| 452 | * interrupts must instead set drm_device->irq_enabled to signal the DRM core | 429 | * interrupts must instead set &drm_device.irq_enabled to signal the DRM core |
| 453 | * that vblank interrupts are available. | 430 | * that vblank interrupts are available. |
| 454 | * | 431 | * |
| 455 | * Returns: | 432 | * Returns: |
| @@ -492,9 +469,6 @@ int drm_irq_install(struct drm_device *dev, int irq) | |||
| 492 | return ret; | 469 | return ret; |
| 493 | } | 470 | } |
| 494 | 471 | ||
| 495 | if (drm_core_check_feature(dev, DRIVER_LEGACY)) | ||
| 496 | vga_client_register(dev->pdev, (void *)dev, drm_irq_vgaarb_nokms, NULL); | ||
| 497 | |||
| 498 | /* After installing handler */ | 472 | /* After installing handler */ |
| 499 | if (dev->driver->irq_postinstall) | 473 | if (dev->driver->irq_postinstall) |
| 500 | ret = dev->driver->irq_postinstall(dev); | 474 | ret = dev->driver->irq_postinstall(dev); |
| @@ -519,7 +493,7 @@ EXPORT_SYMBOL(drm_irq_install); | |||
| 519 | * Calls the driver's irq_uninstall() function and unregisters the IRQ handler. | 493 | * Calls the driver's irq_uninstall() function and unregisters the IRQ handler. |
| 520 | * This should only be called by drivers which used drm_irq_install() to set up | 494 | * This should only be called by drivers which used drm_irq_install() to set up |
| 521 | * their interrupt handler. Other drivers must only reset | 495 | * their interrupt handler. Other drivers must only reset |
| 522 | * drm_device->irq_enabled to false. | 496 | * &drm_device.irq_enabled to false. |
| 523 | * | 497 | * |
| 524 | * Note that for kernel modesetting drivers it is a bug if this function fails. | 498 | * Note that for kernel modesetting drivers it is a bug if this function fails. |
| 525 | * The sanity checks are only to catch buggy user modesetting drivers which call | 499 | * The sanity checks are only to catch buggy user modesetting drivers which call |
| @@ -982,12 +956,11 @@ static void send_vblank_event(struct drm_device *dev, | |||
| 982 | * period. This helper function implements exactly the required vblank arming | 956 | * period. This helper function implements exactly the required vblank arming |
| 983 | * behaviour. | 957 | * behaviour. |
| 984 | * | 958 | * |
| 985 | * NOTE: Drivers using this to send out the event in &struct drm_crtc_state | 959 | * NOTE: Drivers using this to send out the &drm_crtc_state.event as part of an |
| 986 | * as part of an atomic commit must ensure that the next vblank happens at | 960 | * atomic commit must ensure that the next vblank happens at exactly the same |
| 987 | * exactly the same time as the atomic commit is committed to the hardware. This | 961 | * time as the atomic commit is committed to the hardware. This function itself |
| 988 | * function itself does **not** protect again the next vblank interrupt racing | 962 | * does **not** protect again the next vblank interrupt racing with either this |
| 989 | * with either this function call or the atomic commit operation. A possible | 963 | * function call or the atomic commit operation. A possible sequence could be: |
| 990 | * sequence could be: | ||
| 991 | * | 964 | * |
| 992 | * 1. Driver commits new hardware state into vblank-synchronized registers. | 965 | * 1. Driver commits new hardware state into vblank-synchronized registers. |
| 993 | * 2. A vblank happens, committing the hardware state. Also the corresponding | 966 | * 2. A vblank happens, committing the hardware state. Also the corresponding |
diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 229b3f525dee..e51876e588d6 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c | |||
| @@ -552,8 +552,8 @@ EXPORT_SYMBOL(drm_mm_replace_node); | |||
| 552 | * objects to the roster, probably by walking an LRU list, but this can be | 552 | * objects to the roster, probably by walking an LRU list, but this can be |
| 553 | * freely implemented. Eviction candiates are added using | 553 | * freely implemented. Eviction candiates are added using |
| 554 | * drm_mm_scan_add_block() until a suitable hole is found or there are no | 554 | * drm_mm_scan_add_block() until a suitable hole is found or there are no |
| 555 | * further evictable objects. Eviction roster metadata is tracked in struct | 555 | * further evictable objects. Eviction roster metadata is tracked in &struct |
| 556 | * &drm_mm_scan. | 556 | * drm_mm_scan. |
| 557 | * | 557 | * |
| 558 | * The driver must walk through all objects again in exactly the reverse | 558 | * The driver must walk through all objects again in exactly the reverse |
| 559 | * order to restore the allocator state. Note that while the allocator is used | 559 | * order to restore the allocator state. Note that while the allocator is used |
diff --git a/drivers/gpu/drm/drm_mode_config.c b/drivers/gpu/drm/drm_mode_config.c index ed1ee5a44a7b..884cc4d26fb5 100644 --- a/drivers/gpu/drm/drm_mode_config.c +++ b/drivers/gpu/drm/drm_mode_config.c | |||
| @@ -421,7 +421,12 @@ void drm_mode_config_cleanup(struct drm_device *dev) | |||
| 421 | drm_connector_unreference(connector); | 421 | drm_connector_unreference(connector); |
| 422 | } | 422 | } |
| 423 | drm_connector_list_iter_put(&conn_iter); | 423 | drm_connector_list_iter_put(&conn_iter); |
| 424 | WARN_ON(!list_empty(&dev->mode_config.connector_list)); | 424 | if (WARN_ON(!list_empty(&dev->mode_config.connector_list))) { |
| 425 | drm_connector_list_iter_get(dev, &conn_iter); | ||
| 426 | drm_for_each_connector_iter(connector, &conn_iter) | ||
| 427 | DRM_ERROR("connector %s leaked!\n", connector->name); | ||
| 428 | drm_connector_list_iter_put(&conn_iter); | ||
| 429 | } | ||
| 425 | 430 | ||
| 426 | list_for_each_entry_safe(property, pt, &dev->mode_config.property_list, | 431 | list_for_each_entry_safe(property, pt, &dev->mode_config.property_list, |
| 427 | head) { | 432 | head) { |
diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index e6b19bc9021a..a8616b1a8d22 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c | |||
| @@ -797,6 +797,26 @@ int drm_mode_vrefresh(const struct drm_display_mode *mode) | |||
| 797 | EXPORT_SYMBOL(drm_mode_vrefresh); | 797 | EXPORT_SYMBOL(drm_mode_vrefresh); |
| 798 | 798 | ||
| 799 | /** | 799 | /** |
| 800 | * drm_mode_get_hv_timing - Fetches hdisplay/vdisplay for given mode | ||
| 801 | * @mode: mode to query | ||
| 802 | * @hdisplay: hdisplay value to fill in | ||
| 803 | * @vdisplay: vdisplay value to fill in | ||
| 804 | * | ||
| 805 | * The vdisplay value will be doubled if the specified mode is a stereo mode of | ||
| 806 | * the appropriate layout. | ||
| 807 | */ | ||
| 808 | void drm_mode_get_hv_timing(const struct drm_display_mode *mode, | ||
| 809 | int *hdisplay, int *vdisplay) | ||
| 810 | { | ||
| 811 | struct drm_display_mode adjusted = *mode; | ||
| 812 | |||
| 813 | drm_mode_set_crtcinfo(&adjusted, CRTC_STEREO_DOUBLE_ONLY); | ||
| 814 | *hdisplay = adjusted.crtc_hdisplay; | ||
| 815 | *vdisplay = adjusted.crtc_vdisplay; | ||
| 816 | } | ||
| 817 | EXPORT_SYMBOL(drm_mode_get_hv_timing); | ||
| 818 | |||
| 819 | /** | ||
| 800 | * drm_mode_set_crtcinfo - set CRTC modesetting timing parameters | 820 | * drm_mode_set_crtcinfo - set CRTC modesetting timing parameters |
| 801 | * @p: mode | 821 | * @p: mode |
| 802 | * @adjust_flags: a combination of adjustment flags | 822 | * @adjust_flags: a combination of adjustment flags |
diff --git a/drivers/gpu/drm/drm_modeset_lock.c b/drivers/gpu/drm/drm_modeset_lock.c index 3551ae31f143..bf60f2645e55 100644 --- a/drivers/gpu/drm/drm_modeset_lock.c +++ b/drivers/gpu/drm/drm_modeset_lock.c | |||
| @@ -33,7 +33,7 @@ | |||
| 33 | * to use &ww_mutex and acquire-contexts to avoid deadlocks. But because | 33 | * to use &ww_mutex and acquire-contexts to avoid deadlocks. But because |
| 34 | * the locking is more distributed around the driver code, we want a bit | 34 | * the locking is more distributed around the driver code, we want a bit |
| 35 | * of extra utility/tracking out of our acquire-ctx. This is provided | 35 | * of extra utility/tracking out of our acquire-ctx. This is provided |
| 36 | * by drm_modeset_lock / drm_modeset_acquire_ctx. | 36 | * by &struct drm_modeset_lock and &struct drm_modeset_acquire_ctx. |
| 37 | * | 37 | * |
| 38 | * For basic principles of &ww_mutex, see: Documentation/locking/ww-mutex-design.txt | 38 | * For basic principles of &ww_mutex, see: Documentation/locking/ww-mutex-design.txt |
| 39 | * | 39 | * |
| @@ -53,7 +53,7 @@ | |||
| 53 | * drm_modeset_acquire_fini(&ctx); | 53 | * drm_modeset_acquire_fini(&ctx); |
| 54 | * | 54 | * |
| 55 | * On top of of these per-object locks using &ww_mutex there's also an overall | 55 | * On top of of these per-object locks using &ww_mutex there's also an overall |
| 56 | * dev->mode_config.lock, for protecting everything else. Mostly this means | 56 | * &drm_mode_config.mutex, for protecting everything else. Mostly this means |
| 57 | * probe state of connectors, and preventing hotplug add/removal of connectors. | 57 | * probe state of connectors, and preventing hotplug add/removal of connectors. |
| 58 | * | 58 | * |
| 59 | * Finally there's a bunch of dedicated locks to protect drm core internal | 59 | * Finally there's a bunch of dedicated locks to protect drm core internal |
| @@ -71,7 +71,7 @@ static DEFINE_WW_CLASS(crtc_ww_class); | |||
| 71 | * drm_modeset_unlock_all() function. | 71 | * drm_modeset_unlock_all() function. |
| 72 | * | 72 | * |
| 73 | * This function is deprecated. It allocates a lock acquisition context and | 73 | * This function is deprecated. It allocates a lock acquisition context and |
| 74 | * stores it in the DRM device's ->mode_config. This facilitate conversion of | 74 | * stores it in &drm_device.mode_config. This facilitate conversion of |
| 75 | * existing code because it removes the need to manually deal with the | 75 | * existing code because it removes the need to manually deal with the |
| 76 | * acquisition context, but it is also brittle because the context is global | 76 | * acquisition context, but it is also brittle because the context is global |
| 77 | * and care must be taken not to nest calls. New code should use the | 77 | * and care must be taken not to nest calls. New code should use the |
| @@ -124,7 +124,7 @@ EXPORT_SYMBOL(drm_modeset_lock_all); | |||
| 124 | * drm_modeset_lock_all() function. | 124 | * drm_modeset_lock_all() function. |
| 125 | * | 125 | * |
| 126 | * This function is deprecated. It uses the lock acquisition context stored | 126 | * This function is deprecated. It uses the lock acquisition context stored |
| 127 | * in the DRM device's ->mode_config. This facilitates conversion of existing | 127 | * in &drm_device.mode_config. This facilitates conversion of existing |
| 128 | * code because it removes the need to manually deal with the acquisition | 128 | * code because it removes the need to manually deal with the acquisition |
| 129 | * context, but it is also brittle because the context is global and care must | 129 | * context, but it is also brittle because the context is global and care must |
| 130 | * be taken not to nest calls. New code should pass the acquisition context | 130 | * be taken not to nest calls. New code should pass the acquisition context |
| @@ -468,7 +468,7 @@ EXPORT_SYMBOL(drm_modeset_unlock); | |||
| 468 | * This function takes all modeset locks, suitable where a more fine-grained | 468 | * This function takes all modeset locks, suitable where a more fine-grained |
| 469 | * scheme isn't (yet) implemented. | 469 | * scheme isn't (yet) implemented. |
| 470 | * | 470 | * |
| 471 | * Unlike drm_modeset_lock_all(), it doesn't take the dev->mode_config.mutex | 471 | * Unlike drm_modeset_lock_all(), it doesn't take the &drm_mode_config.mutex |
| 472 | * since that lock isn't required for modeset state changes. Callers which | 472 | * since that lock isn't required for modeset state changes. Callers which |
| 473 | * need to grab that lock too need to do so outside of the acquire context | 473 | * need to grab that lock too need to do so outside of the acquire context |
| 474 | * @ctx. | 474 | * @ctx. |
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index dc358f860aea..a3b356e70b35 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c | |||
| @@ -191,7 +191,7 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, | |||
| 191 | static void drm_pci_agp_init(struct drm_device *dev) | 191 | static void drm_pci_agp_init(struct drm_device *dev) |
| 192 | { | 192 | { |
| 193 | if (drm_core_check_feature(dev, DRIVER_USE_AGP)) { | 193 | if (drm_core_check_feature(dev, DRIVER_USE_AGP)) { |
| 194 | if (drm_pci_device_is_agp(dev)) | 194 | if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) |
| 195 | dev->agp = drm_agp_init(dev); | 195 | dev->agp = drm_agp_init(dev); |
| 196 | if (dev->agp) { | 196 | if (dev->agp) { |
| 197 | dev->agp->agp_mtrr = arch_phys_wc_add( | 197 | dev->agp->agp_mtrr = arch_phys_wc_add( |
| @@ -223,7 +223,7 @@ void drm_pci_agp_destroy(struct drm_device *dev) | |||
| 223 | * Try and register, if we fail to register, backout previous work. | 223 | * Try and register, if we fail to register, backout previous work. |
| 224 | * | 224 | * |
| 225 | * NOTE: This function is deprecated, please use drm_dev_alloc() and | 225 | * NOTE: This function is deprecated, please use drm_dev_alloc() and |
| 226 | * drm_dev_register() instead and remove your ->load() callback. | 226 | * drm_dev_register() instead and remove your &drm_driver.load callback. |
| 227 | * | 227 | * |
| 228 | * Return: 0 on success or a negative error code on failure. | 228 | * Return: 0 on success or a negative error code on failure. |
| 229 | */ | 229 | */ |
diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c index eed66be18329..c464fc4a874d 100644 --- a/drivers/gpu/drm/drm_plane.c +++ b/drivers/gpu/drm/drm_plane.c | |||
| @@ -42,7 +42,7 @@ | |||
| 42 | * | 42 | * |
| 43 | * Cursor and overlay planes are optional. All drivers should provide one | 43 | * Cursor and overlay planes are optional. All drivers should provide one |
| 44 | * primary plane per CRTC to avoid surprising userspace too much. See enum | 44 | * primary plane per CRTC to avoid surprising userspace too much. See enum |
| 45 | * &drm_plane_type for a more in-depth discussion of these special uapi-relevant | 45 | * drm_plane_type for a more in-depth discussion of these special uapi-relevant |
| 46 | * plane types. Special planes are associated with their CRTC by calling | 46 | * plane types. Special planes are associated with their CRTC by calling |
| 47 | * drm_crtc_init_with_planes(). | 47 | * drm_crtc_init_with_planes(). |
| 48 | * | 48 | * |
diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index 35d43607a47d..148688fb920a 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c | |||
| @@ -39,9 +39,9 @@ | |||
| 39 | * | 39 | * |
| 40 | * This helper library has two parts. The first part has support to implement | 40 | * This helper library has two parts. The first part has support to implement |
| 41 | * primary plane support on top of the normal CRTC configuration interface. | 41 | * primary plane support on top of the normal CRTC configuration interface. |
| 42 | * Since the legacy ->set_config interface ties the primary plane together with | 42 | * Since the legacy &drm_mode_config_funcs.set_config interface ties the primary |
| 43 | * the CRTC state this does not allow userspace to disable the primary plane | 43 | * plane together with the CRTC state this does not allow userspace to disable |
| 44 | * itself. To avoid too much duplicated code use | 44 | * the primary plane itself. To avoid too much duplicated code use |
| 45 | * drm_plane_helper_check_update() which can be used to enforce the same | 45 | * drm_plane_helper_check_update() which can be used to enforce the same |
| 46 | * restrictions as primary planes had thus. The default primary plane only | 46 | * restrictions as primary planes had thus. The default primary plane only |
| 47 | * expose XRBG8888 and ARGB8888 as valid pixel formats for the attached | 47 | * expose XRBG8888 and ARGB8888 as valid pixel formats for the attached |
| @@ -384,7 +384,8 @@ EXPORT_SYMBOL(drm_primary_helper_update); | |||
| 384 | * is called in response to a userspace SetPlane operation on the plane with a | 384 | * is called in response to a userspace SetPlane operation on the plane with a |
| 385 | * NULL framebuffer parameter. It unconditionally fails the disable call with | 385 | * NULL framebuffer parameter. It unconditionally fails the disable call with |
| 386 | * -EINVAL the only way to disable the primary plane without driver support is | 386 | * -EINVAL the only way to disable the primary plane without driver support is |
| 387 | * to disable the entier CRTC. Which does not match the plane ->disable hook. | 387 | * to disable the entire CRTC. Which does not match the plane |
| 388 | * &drm_plane_funcs.disable_plane hook. | ||
| 388 | * | 389 | * |
| 389 | * Note that some hardware may be able to disable the primary plane without | 390 | * Note that some hardware may be able to disable the primary plane without |
| 390 | * disabling the whole CRTC. Drivers for such hardware should provide their | 391 | * disabling the whole CRTC. Drivers for such hardware should provide their |
diff --git a/drivers/gpu/drm/drm_platform.c b/drivers/gpu/drm/drm_platform.c index 7af3005a030c..56d2f93ed6b9 100644 --- a/drivers/gpu/drm/drm_platform.c +++ b/drivers/gpu/drm/drm_platform.c | |||
| @@ -74,7 +74,7 @@ err_free: | |||
| 74 | * .load() function. | 74 | * .load() function. |
| 75 | * | 75 | * |
| 76 | * NOTE: This function is deprecated, please use drm_dev_alloc() and | 76 | * NOTE: This function is deprecated, please use drm_dev_alloc() and |
| 77 | * drm_dev_register() instead and remove your ->load() callback. | 77 | * drm_dev_register() instead and remove your &drm_driver.load callback. |
| 78 | * | 78 | * |
| 79 | * Return: 0 on success or a negative error code on failure. | 79 | * Return: 0 on success or a negative error code on failure. |
| 80 | */ | 80 | */ |
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c index 8d77b2462594..25aa4558f1b5 100644 --- a/drivers/gpu/drm/drm_prime.c +++ b/drivers/gpu/drm/drm_prime.c | |||
| @@ -40,8 +40,11 @@ | |||
| 40 | * On the export the dma_buf holds a reference to the exporting GEM | 40 | * On the export the dma_buf holds a reference to the exporting GEM |
| 41 | * object. It takes this reference in handle_to_fd_ioctl, when it | 41 | * object. It takes this reference in handle_to_fd_ioctl, when it |
| 42 | * first calls .prime_export and stores the exporting GEM object in | 42 | * first calls .prime_export and stores the exporting GEM object in |
| 43 | * the dma_buf priv. This reference is released when the dma_buf | 43 | * the dma_buf priv. This reference needs to be released when the |
| 44 | * object goes away in the driver .release function. | 44 | * final reference to the &dma_buf itself is dropped and its |
| 45 | * &dma_buf_ops.release function is called. For GEM-based drivers, | ||
| 46 | * the dma_buf should be exported using drm_gem_dmabuf_export() and | ||
| 47 | * then released by drm_gem_dmabuf_release(). | ||
| 45 | * | 48 | * |
| 46 | * On the import the importing GEM object holds a reference to the | 49 | * On the import the importing GEM object holds a reference to the |
| 47 | * dma_buf (which in turn holds a ref to the exporting GEM object). | 50 | * dma_buf (which in turn holds a ref to the exporting GEM object). |
| @@ -51,6 +54,16 @@ | |||
| 51 | * when the imported object is destroyed, we remove the attachment | 54 | * when the imported object is destroyed, we remove the attachment |
| 52 | * and drop the reference to the dma_buf. | 55 | * and drop the reference to the dma_buf. |
| 53 | * | 56 | * |
| 57 | * When all the references to the &dma_buf are dropped, i.e. when | ||
| 58 | * userspace has closed both handles to the imported GEM object (through the | ||
| 59 | * FD_TO_HANDLE IOCTL) and closed the file descriptor of the exported | ||
| 60 | * (through the HANDLE_TO_FD IOCTL) dma_buf, and all kernel-internal references | ||
| 61 | * are also gone, then the dma_buf gets destroyed. This can also happen as a | ||
| 62 | * part of the clean up procedure in the drm_release() function if userspace | ||
| 63 | * fails to properly clean up. Note that both the kernel and userspace (by | ||
| 64 | * keeeping the PRIME file descriptors open) can hold references onto a | ||
| 65 | * &dma_buf. | ||
| 66 | * | ||
| 54 | * Thus the chain of references always flows in one direction | 67 | * Thus the chain of references always flows in one direction |
| 55 | * (avoiding loops): importing_gem -> dmabuf -> exporting_gem | 68 | * (avoiding loops): importing_gem -> dmabuf -> exporting_gem |
| 56 | * | 69 | * |
| @@ -291,7 +304,7 @@ static void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach, | |||
| 291 | * This wraps dma_buf_export() for use by generic GEM drivers that are using | 304 | * This wraps dma_buf_export() for use by generic GEM drivers that are using |
| 292 | * drm_gem_dmabuf_release(). In addition to calling dma_buf_export(), we take | 305 | * drm_gem_dmabuf_release(). In addition to calling dma_buf_export(), we take |
| 293 | * a reference to the &drm_device and the exported &drm_gem_object (stored in | 306 | * a reference to the &drm_device and the exported &drm_gem_object (stored in |
| 294 | * exp_info->priv) which is released by drm_gem_dmabuf_release(). | 307 | * &dma_buf_export_info.priv) which is released by drm_gem_dmabuf_release(). |
| 295 | * | 308 | * |
| 296 | * Returns the new dmabuf. | 309 | * Returns the new dmabuf. |
| 297 | */ | 310 | */ |
diff --git a/drivers/gpu/drm/drm_probe_helper.c b/drivers/gpu/drm/drm_probe_helper.c index 041a5504780f..93381454bdf7 100644 --- a/drivers/gpu/drm/drm_probe_helper.c +++ b/drivers/gpu/drm/drm_probe_helper.c | |||
| @@ -43,7 +43,7 @@ | |||
| 43 | * DOC: output probing helper overview | 43 | * DOC: output probing helper overview |
| 44 | * | 44 | * |
| 45 | * This library provides some helper code for output probing. It provides an | 45 | * This library provides some helper code for output probing. It provides an |
| 46 | * implementation of the core connector->fill_modes interface with | 46 | * implementation of the core &drm_connector_funcs.fill_modes interface with |
| 47 | * drm_helper_probe_single_connector_modes. | 47 | * drm_helper_probe_single_connector_modes. |
| 48 | * | 48 | * |
| 49 | * It also provides support for polling connectors with a work item and for | 49 | * It also provides support for polling connectors with a work item and for |
| @@ -187,9 +187,9 @@ drm_connector_detect(struct drm_connector *connector, bool force) | |||
| 187 | * be added to the connector's probed_modes list, then culled (based on validity | 187 | * be added to the connector's probed_modes list, then culled (based on validity |
| 188 | * and the @maxX, @maxY parameters) and put into the normal modes list. | 188 | * and the @maxX, @maxY parameters) and put into the normal modes list. |
| 189 | * | 189 | * |
| 190 | * Intended to be used as a generic implementation of the ->fill_modes() | 190 | * Intended to be used as a generic implementation of the |
| 191 | * @connector vfunc for drivers that use the CRTC helpers for output mode | 191 | * &drm_connector_funcs.fill_modes() vfunc for drivers that use the CRTC helpers |
| 192 | * filtering and detection. | 192 | * for output mode filtering and detection. |
| 193 | * | 193 | * |
| 194 | * The basic procedure is as follows | 194 | * The basic procedure is as follows |
| 195 | * | 195 | * |
| @@ -201,7 +201,7 @@ drm_connector_detect(struct drm_connector *connector, bool force) | |||
| 201 | * | 201 | * |
| 202 | * - debugfs 'override_edid' (used for testing only) | 202 | * - debugfs 'override_edid' (used for testing only) |
| 203 | * - firmware EDID (drm_load_edid_firmware()) | 203 | * - firmware EDID (drm_load_edid_firmware()) |
| 204 | * - connector helper ->get_modes() vfunc | 204 | * - &drm_connector_helper_funcs.get_modes vfunc |
| 205 | * - if the connector status is connector_status_connected, standard | 205 | * - if the connector status is connector_status_connected, standard |
| 206 | * VESA DMT modes up to 1024x768 are automatically added | 206 | * VESA DMT modes up to 1024x768 are automatically added |
| 207 | * (drm_add_modes_noedid()) | 207 | * (drm_add_modes_noedid()) |
| @@ -222,8 +222,8 @@ drm_connector_detect(struct drm_connector *connector, bool force) | |||
| 222 | * (if specified) | 222 | * (if specified) |
| 223 | * - drm_mode_validate_flag() checks the modes againt basic connector | 223 | * - drm_mode_validate_flag() checks the modes againt basic connector |
| 224 | * capabilites (interlace_allowed,doublescan_allowed,stereo_allowed) | 224 | * capabilites (interlace_allowed,doublescan_allowed,stereo_allowed) |
| 225 | * - the optional connector ->mode_valid() helper can perform driver and/or | 225 | * - the optional &drm_connector_helper_funcs.mode_valid helper can perform |
| 226 | * hardware specific checks | 226 | * driver and/or hardware specific checks |
| 227 | * | 227 | * |
| 228 | * 5. Any mode whose status is not OK is pruned from the connector's modes list, | 228 | * 5. Any mode whose status is not OK is pruned from the connector's modes list, |
| 229 | * accompanied by a debug message indicating the reason for the mode's | 229 | * accompanied by a debug message indicating the reason for the mode's |
diff --git a/drivers/gpu/drm/drm_property.c b/drivers/gpu/drm/drm_property.c index 0d0e5dc0ee23..7fc070f3e49e 100644 --- a/drivers/gpu/drm/drm_property.c +++ b/drivers/gpu/drm/drm_property.c | |||
| @@ -42,8 +42,8 @@ | |||
| 42 | * drm_object_attach_property(). | 42 | * drm_object_attach_property(). |
| 43 | * | 43 | * |
| 44 | * Property values are only 64bit. To support bigger piles of data (like gamma | 44 | * Property values are only 64bit. To support bigger piles of data (like gamma |
| 45 | * tables, color correction matrizes or large structures) a property can instead | 45 | * tables, color correction matrices or large structures) a property can instead |
| 46 | * point at a &drm_property_blob with that additional data | 46 | * point at a &drm_property_blob with that additional data. |
| 47 | * | 47 | * |
| 48 | * Properties are defined by their symbolic name, userspace must keep a | 48 | * Properties are defined by their symbolic name, userspace must keep a |
| 49 | * per-object mapping from those names to the property ID used in the atomic | 49 | * per-object mapping from those names to the property ID used in the atomic |
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c index 9a37196c1bf1..513288b5c2f6 100644 --- a/drivers/gpu/drm/drm_sysfs.c +++ b/drivers/gpu/drm/drm_sysfs.c | |||
| @@ -255,7 +255,7 @@ static const struct attribute_group *connector_dev_groups[] = { | |||
| 255 | * @connector: connector to add | 255 | * @connector: connector to add |
| 256 | * | 256 | * |
| 257 | * Create a connector device in sysfs, along with its associated connector | 257 | * Create a connector device in sysfs, along with its associated connector |
| 258 | * properties (so far, connection status, dpms, mode list & edid) and | 258 | * properties (so far, connection status, dpms, mode list and edid) and |
| 259 | * generate a hotplug event so userspace knows there's a new connector | 259 | * generate a hotplug event so userspace knows there's a new connector |
| 260 | * available. | 260 | * available. |
| 261 | */ | 261 | */ |
diff --git a/drivers/gpu/drm/etnaviv/Kconfig b/drivers/gpu/drm/etnaviv/Kconfig index 656c061b439d..cc1731c5289c 100644 --- a/drivers/gpu/drm/etnaviv/Kconfig +++ b/drivers/gpu/drm/etnaviv/Kconfig | |||
| @@ -2,7 +2,7 @@ | |||
| 2 | config DRM_ETNAVIV | 2 | config DRM_ETNAVIV |
| 3 | tristate "ETNAVIV (DRM support for Vivante GPU IP cores)" | 3 | tristate "ETNAVIV (DRM support for Vivante GPU IP cores)" |
| 4 | depends on DRM | 4 | depends on DRM |
| 5 | depends on ARCH_MXC || ARCH_DOVE | 5 | depends on ARCH_MXC || ARCH_DOVE || (ARM && COMPILE_TEST) |
| 6 | depends on MMU | 6 | depends on MMU |
| 7 | select SHMEM | 7 | select SHMEM |
| 8 | select TMPFS | 8 | select TMPFS |
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index b92c24e07cea..590be0d1dd95 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c | |||
| @@ -258,12 +258,6 @@ static int etnaviv_debugfs_init(struct drm_minor *minor) | |||
| 258 | 258 | ||
| 259 | return ret; | 259 | return ret; |
| 260 | } | 260 | } |
| 261 | |||
| 262 | static void etnaviv_debugfs_cleanup(struct drm_minor *minor) | ||
| 263 | { | ||
| 264 | drm_debugfs_remove_files(etnaviv_debugfs_list, | ||
| 265 | ARRAY_SIZE(etnaviv_debugfs_list), minor); | ||
| 266 | } | ||
| 267 | #endif | 261 | #endif |
| 268 | 262 | ||
| 269 | /* | 263 | /* |
| @@ -509,7 +503,6 @@ static struct drm_driver etnaviv_drm_driver = { | |||
| 509 | .gem_prime_mmap = etnaviv_gem_prime_mmap, | 503 | .gem_prime_mmap = etnaviv_gem_prime_mmap, |
| 510 | #ifdef CONFIG_DEBUG_FS | 504 | #ifdef CONFIG_DEBUG_FS |
| 511 | .debugfs_init = etnaviv_debugfs_init, | 505 | .debugfs_init = etnaviv_debugfs_init, |
| 512 | .debugfs_cleanup = etnaviv_debugfs_cleanup, | ||
| 513 | #endif | 506 | #endif |
| 514 | .ioctls = etnaviv_ioctls, | 507 | .ioctls = etnaviv_ioctls, |
| 515 | .num_ioctls = DRM_ETNAVIV_NUM_IOCTLS, | 508 | .num_ioctls = DRM_ETNAVIV_NUM_IOCTLS, |
diff --git a/drivers/gpu/drm/exynos/Kconfig b/drivers/gpu/drm/exynos/Kconfig index d706ca4e2f02..1d185347c64c 100644 --- a/drivers/gpu/drm/exynos/Kconfig +++ b/drivers/gpu/drm/exynos/Kconfig | |||
| @@ -19,7 +19,6 @@ comment "CRTCs" | |||
| 19 | config DRM_EXYNOS_FIMD | 19 | config DRM_EXYNOS_FIMD |
| 20 | bool "FIMD" | 20 | bool "FIMD" |
| 21 | depends on !FB_S3C | 21 | depends on !FB_S3C |
| 22 | select FB_MODE_HELPERS | ||
| 23 | select MFD_SYSCON | 22 | select MFD_SYSCON |
| 24 | help | 23 | help |
| 25 | Choose this option if you want to use Exynos FIMD for DRM. | 24 | Choose this option if you want to use Exynos FIMD for DRM. |
| @@ -32,7 +31,6 @@ config DRM_EXYNOS5433_DECON | |||
| 32 | config DRM_EXYNOS7_DECON | 31 | config DRM_EXYNOS7_DECON |
| 33 | bool "DECON on Exynos7" | 32 | bool "DECON on Exynos7" |
| 34 | depends on !FB_S3C | 33 | depends on !FB_S3C |
| 35 | select FB_MODE_HELPERS | ||
| 36 | help | 34 | help |
| 37 | Choose this option if you want to use Exynos DECON for DRM. | 35 | Choose this option if you want to use Exynos DECON for DRM. |
| 38 | 36 | ||
diff --git a/drivers/gpu/drm/gma500/psb_drv.c b/drivers/gpu/drm/gma500/psb_drv.c index 0dc7ba2fdc22..5ee93ff55608 100644 --- a/drivers/gpu/drm/gma500/psb_drv.c +++ b/drivers/gpu/drm/gma500/psb_drv.c | |||
| @@ -406,11 +406,6 @@ out_err: | |||
| 406 | return ret; | 406 | return ret; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | static int psb_driver_device_is_agp(struct drm_device *dev) | ||
| 410 | { | ||
| 411 | return 0; | ||
| 412 | } | ||
| 413 | |||
| 414 | static inline void get_brightness(struct backlight_device *bd) | 409 | static inline void get_brightness(struct backlight_device *bd) |
| 415 | { | 410 | { |
| 416 | #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE | 411 | #ifdef CONFIG_BACKLIGHT_CLASS_DEVICE |
| @@ -487,7 +482,6 @@ static struct drm_driver driver = { | |||
| 487 | .set_busid = drm_pci_set_busid, | 482 | .set_busid = drm_pci_set_busid, |
| 488 | 483 | ||
| 489 | .num_ioctls = ARRAY_SIZE(psb_ioctls), | 484 | .num_ioctls = ARRAY_SIZE(psb_ioctls), |
| 490 | .device_is_agp = psb_driver_device_is_agp, | ||
| 491 | .irq_preinstall = psb_irq_preinstall, | 485 | .irq_preinstall = psb_irq_preinstall, |
| 492 | .irq_postinstall = psb_irq_postinstall, | 486 | .irq_postinstall = psb_irq_postinstall, |
| 493 | .irq_uninstall = psb_irq_uninstall, | 487 | .irq_uninstall = psb_irq_uninstall, |
diff --git a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c index 7a6957ae4b44..16fe79053ee1 100644 --- a/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c +++ b/drivers/gpu/drm/hisilicon/hibmc/hibmc_drm_fbdev.c | |||
| @@ -121,7 +121,7 @@ static int hibmc_drm_fb_create(struct drm_fb_helper *helper, | |||
| 121 | 121 | ||
| 122 | hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj); | 122 | hi_fbdev->fb = hibmc_framebuffer_init(priv->dev, &mode_cmd, gobj); |
| 123 | if (IS_ERR(hi_fbdev->fb)) { | 123 | if (IS_ERR(hi_fbdev->fb)) { |
| 124 | ret = PTR_ERR(info); | 124 | ret = PTR_ERR(hi_fbdev->fb); |
| 125 | DRM_ERROR("failed to initialize framebuffer: %d\n", ret); | 125 | DRM_ERROR("failed to initialize framebuffer: %d\n", ret); |
| 126 | goto out_release_fbi; | 126 | goto out_release_fbi; |
| 127 | } | 127 | } |
diff --git a/drivers/gpu/drm/i810/i810_dma.c b/drivers/gpu/drm/i810/i810_dma.c index ab4e6cbe1f8b..576a417690d4 100644 --- a/drivers/gpu/drm/i810/i810_dma.c +++ b/drivers/gpu/drm/i810/i810_dma.c | |||
| @@ -1190,6 +1190,14 @@ static int i810_flip_bufs(struct drm_device *dev, void *data, | |||
| 1190 | 1190 | ||
| 1191 | int i810_driver_load(struct drm_device *dev, unsigned long flags) | 1191 | int i810_driver_load(struct drm_device *dev, unsigned long flags) |
| 1192 | { | 1192 | { |
| 1193 | dev->agp = drm_agp_init(dev); | ||
| 1194 | if (dev->agp) { | ||
| 1195 | dev->agp->agp_mtrr = arch_phys_wc_add( | ||
| 1196 | dev->agp->agp_info.aper_base, | ||
| 1197 | dev->agp->agp_info.aper_size * | ||
| 1198 | 1024 * 1024); | ||
| 1199 | } | ||
| 1200 | |||
| 1193 | /* Our userspace depends upon the agp mapping support. */ | 1201 | /* Our userspace depends upon the agp mapping support. */ |
| 1194 | if (!dev->agp) | 1202 | if (!dev->agp) |
| 1195 | return -EINVAL; | 1203 | return -EINVAL; |
| @@ -1249,19 +1257,3 @@ const struct drm_ioctl_desc i810_ioctls[] = { | |||
| 1249 | }; | 1257 | }; |
| 1250 | 1258 | ||
| 1251 | int i810_max_ioctl = ARRAY_SIZE(i810_ioctls); | 1259 | int i810_max_ioctl = ARRAY_SIZE(i810_ioctls); |
| 1252 | |||
| 1253 | /** | ||
| 1254 | * Determine if the device really is AGP or not. | ||
| 1255 | * | ||
| 1256 | * All Intel graphics chipsets are treated as AGP, even if they are really | ||
| 1257 | * PCI-e. | ||
| 1258 | * | ||
| 1259 | * \param dev The device to be tested. | ||
| 1260 | * | ||
| 1261 | * \returns | ||
| 1262 | * A value of 1 is always retured to indictate every i810 is AGP. | ||
| 1263 | */ | ||
| 1264 | int i810_driver_device_is_agp(struct drm_device *dev) | ||
| 1265 | { | ||
| 1266 | return 1; | ||
| 1267 | } | ||
diff --git a/drivers/gpu/drm/i810/i810_drv.c b/drivers/gpu/drm/i810/i810_drv.c index 02504a7cfaf2..37fd0906f807 100644 --- a/drivers/gpu/drm/i810/i810_drv.c +++ b/drivers/gpu/drm/i810/i810_drv.c | |||
| @@ -60,7 +60,6 @@ static struct drm_driver driver = { | |||
| 60 | .lastclose = i810_driver_lastclose, | 60 | .lastclose = i810_driver_lastclose, |
| 61 | .preclose = i810_driver_preclose, | 61 | .preclose = i810_driver_preclose, |
| 62 | .set_busid = drm_pci_set_busid, | 62 | .set_busid = drm_pci_set_busid, |
| 63 | .device_is_agp = i810_driver_device_is_agp, | ||
| 64 | .dma_quiescent = i810_driver_dma_quiescent, | 63 | .dma_quiescent = i810_driver_dma_quiescent, |
| 65 | .ioctls = i810_ioctls, | 64 | .ioctls = i810_ioctls, |
| 66 | .fops = &i810_driver_fops, | 65 | .fops = &i810_driver_fops, |
diff --git a/drivers/gpu/drm/i810/i810_drv.h b/drivers/gpu/drm/i810/i810_drv.h index 93ec5dc4e7d3..c73d2f2da57b 100644 --- a/drivers/gpu/drm/i810/i810_drv.h +++ b/drivers/gpu/drm/i810/i810_drv.h | |||
| @@ -124,7 +124,6 @@ extern int i810_driver_load(struct drm_device *, unsigned long flags); | |||
| 124 | extern void i810_driver_lastclose(struct drm_device *dev); | 124 | extern void i810_driver_lastclose(struct drm_device *dev); |
| 125 | extern void i810_driver_preclose(struct drm_device *dev, | 125 | extern void i810_driver_preclose(struct drm_device *dev, |
| 126 | struct drm_file *file_priv); | 126 | struct drm_file *file_priv); |
| 127 | extern int i810_driver_device_is_agp(struct drm_device *dev); | ||
| 128 | 127 | ||
| 129 | extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg); | 128 | extern long i810_ioctl(struct file *file, unsigned int cmd, unsigned long arg); |
| 130 | extern const struct drm_ioctl_desc i810_ioctls[]; | 129 | extern const struct drm_ioctl_desc i810_ioctls[]; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0f4272f98648..b3e773c9f872 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
| @@ -11092,7 +11092,7 @@ static int intel_modeset_setup_plane_state(struct drm_atomic_state *state, | |||
| 11092 | return PTR_ERR(plane_state); | 11092 | return PTR_ERR(plane_state); |
| 11093 | 11093 | ||
| 11094 | if (mode) | 11094 | if (mode) |
| 11095 | drm_crtc_get_hv_timing(mode, &hdisplay, &vdisplay); | 11095 | drm_mode_get_hv_timing(mode, &hdisplay, &vdisplay); |
| 11096 | else | 11096 | else |
| 11097 | hdisplay = vdisplay = 0; | 11097 | hdisplay = vdisplay = 0; |
| 11098 | 11098 | ||
| @@ -12981,7 +12981,7 @@ intel_modeset_pipe_config(struct drm_crtc *crtc, | |||
| 12981 | * computation to clearly distinguish it from the adjusted mode, which | 12981 | * computation to clearly distinguish it from the adjusted mode, which |
| 12982 | * can be changed by the connectors in the below retry loop. | 12982 | * can be changed by the connectors in the below retry loop. |
| 12983 | */ | 12983 | */ |
| 12984 | drm_crtc_get_hv_timing(&pipe_config->base.mode, | 12984 | drm_mode_get_hv_timing(&pipe_config->base.mode, |
| 12985 | &pipe_config->pipe_src_w, | 12985 | &pipe_config->pipe_src_w, |
| 12986 | &pipe_config->pipe_src_h); | 12986 | &pipe_config->pipe_src_h); |
| 12987 | 12987 | ||
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e80d620846c8..3d8ac8aa7214 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c | |||
| @@ -1713,7 +1713,9 @@ found: | |||
| 1713 | * VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry | 1713 | * VESA DisplayPort Ver.1.2a - 5.1.1.1 Video Colorimetry |
| 1714 | */ | 1714 | */ |
| 1715 | pipe_config->limited_color_range = | 1715 | pipe_config->limited_color_range = |
| 1716 | bpp != 18 && drm_match_cea_mode(adjusted_mode) > 1; | 1716 | bpp != 18 && |
| 1717 | drm_default_rgb_quant_range(adjusted_mode) == | ||
| 1718 | HDMI_QUANTIZATION_RANGE_LIMITED; | ||
| 1717 | } else { | 1719 | } else { |
| 1718 | pipe_config->limited_color_range = | 1720 | pipe_config->limited_color_range = |
| 1719 | intel_dp->limited_color_range; | 1721 | intel_dp->limited_color_range; |
diff --git a/drivers/gpu/drm/i915/intel_dp_mst.c b/drivers/gpu/drm/i915/intel_dp_mst.c index 205fe4748ec5..38e3ca2f6f18 100644 --- a/drivers/gpu/drm/i915/intel_dp_mst.c +++ b/drivers/gpu/drm/i915/intel_dp_mst.c | |||
| @@ -587,7 +587,8 @@ intel_dp_mst_encoder_init(struct intel_digital_port *intel_dig_port, int conn_ba | |||
| 587 | 587 | ||
| 588 | /* create encoders */ | 588 | /* create encoders */ |
| 589 | intel_dp_create_fake_mst_encoders(intel_dig_port); | 589 | intel_dp_create_fake_mst_encoders(intel_dig_port); |
| 590 | ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev->dev, &intel_dp->aux, 16, 3, conn_base_id); | 590 | ret = drm_dp_mst_topology_mgr_init(&intel_dp->mst_mgr, dev, |
| 591 | &intel_dp->aux, 16, 3, conn_base_id); | ||
| 591 | if (ret) { | 592 | if (ret) { |
| 592 | intel_dp->can_mst = false; | 593 | intel_dp->can_mst = false; |
| 593 | return ret; | 594 | return ret; |
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 0bcfead14571..af16b0fa6b69 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
| @@ -455,24 +455,23 @@ static void intel_hdmi_set_avi_infoframe(struct drm_encoder *encoder, | |||
| 455 | const struct intel_crtc_state *crtc_state) | 455 | const struct intel_crtc_state *crtc_state) |
| 456 | { | 456 | { |
| 457 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | 457 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); |
| 458 | const struct drm_display_mode *adjusted_mode = | ||
| 459 | &crtc_state->base.adjusted_mode; | ||
| 458 | union hdmi_infoframe frame; | 460 | union hdmi_infoframe frame; |
| 459 | int ret; | 461 | int ret; |
| 460 | 462 | ||
| 461 | ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, | 463 | ret = drm_hdmi_avi_infoframe_from_display_mode(&frame.avi, |
| 462 | &crtc_state->base.adjusted_mode); | 464 | adjusted_mode); |
| 463 | if (ret < 0) { | 465 | if (ret < 0) { |
| 464 | DRM_ERROR("couldn't fill AVI infoframe\n"); | 466 | DRM_ERROR("couldn't fill AVI infoframe\n"); |
| 465 | return; | 467 | return; |
| 466 | } | 468 | } |
| 467 | 469 | ||
| 468 | if (intel_hdmi->rgb_quant_range_selectable) { | 470 | drm_hdmi_avi_infoframe_quant_range(&frame.avi, adjusted_mode, |
| 469 | if (crtc_state->limited_color_range) | 471 | crtc_state->limited_color_range ? |
| 470 | frame.avi.quantization_range = | 472 | HDMI_QUANTIZATION_RANGE_LIMITED : |
| 471 | HDMI_QUANTIZATION_RANGE_LIMITED; | 473 | HDMI_QUANTIZATION_RANGE_FULL, |
| 472 | else | 474 | intel_hdmi->rgb_quant_range_selectable); |
| 473 | frame.avi.quantization_range = | ||
| 474 | HDMI_QUANTIZATION_RANGE_FULL; | ||
| 475 | } | ||
| 476 | 475 | ||
| 477 | intel_write_infoframe(encoder, crtc_state, &frame); | 476 | intel_write_infoframe(encoder, crtc_state, &frame); |
| 478 | } | 477 | } |
| @@ -1330,7 +1329,8 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder, | |||
| 1330 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ | 1329 | /* See CEA-861-E - 5.1 Default Encoding Parameters */ |
| 1331 | pipe_config->limited_color_range = | 1330 | pipe_config->limited_color_range = |
| 1332 | pipe_config->has_hdmi_sink && | 1331 | pipe_config->has_hdmi_sink && |
| 1333 | drm_match_cea_mode(adjusted_mode) > 1; | 1332 | drm_default_rgb_quant_range(adjusted_mode) == |
| 1333 | HDMI_QUANTIZATION_RANGE_LIMITED; | ||
| 1334 | } else { | 1334 | } else { |
| 1335 | pipe_config->limited_color_range = | 1335 | pipe_config->limited_color_range = |
| 1336 | intel_hdmi->limited_color_range; | 1336 | intel_hdmi->limited_color_range; |
diff --git a/drivers/gpu/drm/mga/mga_dma.c b/drivers/gpu/drm/mga/mga_dma.c index a1d8dd15b131..1ffdafea27e4 100644 --- a/drivers/gpu/drm/mga/mga_dma.c +++ b/drivers/gpu/drm/mga/mga_dma.c | |||
| @@ -392,6 +392,24 @@ int mga_driver_load(struct drm_device *dev, unsigned long flags) | |||
| 392 | drm_mga_private_t *dev_priv; | 392 | drm_mga_private_t *dev_priv; |
| 393 | int ret; | 393 | int ret; |
| 394 | 394 | ||
| 395 | /* There are PCI versions of the G450. These cards have the | ||
| 396 | * same PCI ID as the AGP G450, but have an additional PCI-to-PCI | ||
| 397 | * bridge chip. We detect these cards, which are not currently | ||
| 398 | * supported by this driver, by looking at the device ID of the | ||
| 399 | * bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the | ||
| 400 | * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the | ||
| 401 | * device. | ||
| 402 | */ | ||
| 403 | if ((dev->pdev->device == 0x0525) && dev->pdev->bus->self | ||
| 404 | && (dev->pdev->bus->self->vendor == 0x3388) | ||
| 405 | && (dev->pdev->bus->self->device == 0x0021) | ||
| 406 | && dev->agp) { | ||
| 407 | /* FIXME: This should be quirked in the pci core, but oh well | ||
| 408 | * the hw probably stopped existing. */ | ||
| 409 | arch_phys_wc_del(dev->agp->agp_mtrr); | ||
| 410 | kfree(dev->agp); | ||
| 411 | dev->agp = NULL; | ||
| 412 | } | ||
| 395 | dev_priv = kzalloc(sizeof(drm_mga_private_t), GFP_KERNEL); | 413 | dev_priv = kzalloc(sizeof(drm_mga_private_t), GFP_KERNEL); |
| 396 | if (!dev_priv) | 414 | if (!dev_priv) |
| 397 | return -ENOMEM; | 415 | return -ENOMEM; |
| @@ -698,7 +716,7 @@ static int mga_do_pci_dma_bootstrap(struct drm_device *dev, | |||
| 698 | static int mga_do_dma_bootstrap(struct drm_device *dev, | 716 | static int mga_do_dma_bootstrap(struct drm_device *dev, |
| 699 | drm_mga_dma_bootstrap_t *dma_bs) | 717 | drm_mga_dma_bootstrap_t *dma_bs) |
| 700 | { | 718 | { |
| 701 | const int is_agp = (dma_bs->agp_mode != 0) && drm_pci_device_is_agp(dev); | 719 | const int is_agp = (dma_bs->agp_mode != 0) && dev->agp; |
| 702 | int err; | 720 | int err; |
| 703 | drm_mga_private_t *const dev_priv = | 721 | drm_mga_private_t *const dev_priv = |
| 704 | (drm_mga_private_t *) dev->dev_private; | 722 | (drm_mga_private_t *) dev->dev_private; |
diff --git a/drivers/gpu/drm/mga/mga_drv.c b/drivers/gpu/drm/mga/mga_drv.c index 25b2a1a424e6..63ba0699d107 100644 --- a/drivers/gpu/drm/mga/mga_drv.c +++ b/drivers/gpu/drm/mga/mga_drv.c | |||
| @@ -37,8 +37,6 @@ | |||
| 37 | 37 | ||
| 38 | #include <drm/drm_pciids.h> | 38 | #include <drm/drm_pciids.h> |
| 39 | 39 | ||
| 40 | static int mga_driver_device_is_agp(struct drm_device *dev); | ||
| 41 | |||
| 42 | static struct pci_device_id pciidlist[] = { | 40 | static struct pci_device_id pciidlist[] = { |
| 43 | mga_PCI_IDS | 41 | mga_PCI_IDS |
| 44 | }; | 42 | }; |
| @@ -66,7 +64,6 @@ static struct drm_driver driver = { | |||
| 66 | .lastclose = mga_driver_lastclose, | 64 | .lastclose = mga_driver_lastclose, |
| 67 | .set_busid = drm_pci_set_busid, | 65 | .set_busid = drm_pci_set_busid, |
| 68 | .dma_quiescent = mga_driver_dma_quiescent, | 66 | .dma_quiescent = mga_driver_dma_quiescent, |
| 69 | .device_is_agp = mga_driver_device_is_agp, | ||
| 70 | .get_vblank_counter = mga_get_vblank_counter, | 67 | .get_vblank_counter = mga_get_vblank_counter, |
| 71 | .enable_vblank = mga_enable_vblank, | 68 | .enable_vblank = mga_enable_vblank, |
| 72 | .disable_vblank = mga_disable_vblank, | 69 | .disable_vblank = mga_disable_vblank, |
| @@ -107,37 +104,3 @@ module_exit(mga_exit); | |||
| 107 | MODULE_AUTHOR(DRIVER_AUTHOR); | 104 | MODULE_AUTHOR(DRIVER_AUTHOR); |
| 108 | MODULE_DESCRIPTION(DRIVER_DESC); | 105 | MODULE_DESCRIPTION(DRIVER_DESC); |
| 109 | MODULE_LICENSE("GPL and additional rights"); | 106 | MODULE_LICENSE("GPL and additional rights"); |
| 110 | |||
| 111 | /** | ||
| 112 | * Determine if the device really is AGP or not. | ||
| 113 | * | ||
| 114 | * In addition to the usual tests performed by \c drm_device_is_agp, this | ||
| 115 | * function detects PCI G450 cards that appear to the system exactly like | ||
| 116 | * AGP G450 cards. | ||
| 117 | * | ||
| 118 | * \param dev The device to be tested. | ||
| 119 | * | ||
| 120 | * \returns | ||
| 121 | * If the device is a PCI G450, zero is returned. Otherwise 2 is returned. | ||
| 122 | */ | ||
| 123 | static int mga_driver_device_is_agp(struct drm_device *dev) | ||
| 124 | { | ||
| 125 | const struct pci_dev *const pdev = dev->pdev; | ||
| 126 | |||
| 127 | /* There are PCI versions of the G450. These cards have the | ||
| 128 | * same PCI ID as the AGP G450, but have an additional PCI-to-PCI | ||
| 129 | * bridge chip. We detect these cards, which are not currently | ||
| 130 | * supported by this driver, by looking at the device ID of the | ||
| 131 | * bus the "card" is on. If vendor is 0x3388 (Hint Corp) and the | ||
| 132 | * device is 0x0021 (HB6 Universal PCI-PCI bridge), we reject the | ||
| 133 | * device. | ||
| 134 | */ | ||
| 135 | |||
| 136 | if ((pdev->device == 0x0525) && pdev->bus->self | ||
| 137 | && (pdev->bus->self->vendor == 0x3388) | ||
| 138 | && (pdev->bus->self->device == 0x0021)) { | ||
| 139 | return 0; | ||
| 140 | } | ||
| 141 | |||
| 142 | return 2; | ||
| 143 | } | ||
diff --git a/drivers/gpu/drm/nouveau/nouveau_abi16.c b/drivers/gpu/drm/nouveau/nouveau_abi16.c index 7bd4683216d0..4df4f6ed4886 100644 --- a/drivers/gpu/drm/nouveau/nouveau_abi16.c +++ b/drivers/gpu/drm/nouveau/nouveau_abi16.c | |||
| @@ -199,7 +199,7 @@ nouveau_abi16_ioctl_getparam(ABI16_IOCTL_ARGS) | |||
| 199 | if (!nvxx_device(device)->func->pci) | 199 | if (!nvxx_device(device)->func->pci) |
| 200 | getparam->value = 3; | 200 | getparam->value = 3; |
| 201 | else | 201 | else |
| 202 | if (drm_pci_device_is_agp(dev)) | 202 | if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) |
| 203 | getparam->value = 0; | 203 | getparam->value = 0; |
| 204 | else | 204 | else |
| 205 | if (!pci_is_pcie(dev->pdev)) | 205 | if (!pci_is_pcie(dev->pdev)) |
diff --git a/drivers/gpu/drm/nouveau/nv50_display.c b/drivers/gpu/drm/nouveau/nv50_display.c index cb85cb72dc1c..452da483ca01 100644 --- a/drivers/gpu/drm/nouveau/nv50_display.c +++ b/drivers/gpu/drm/nouveau/nv50_display.c | |||
| @@ -3417,7 +3417,7 @@ nv50_mstm_new(struct nouveau_encoder *outp, struct drm_dp_aux *aux, int aux_max, | |||
| 3417 | mstm->outp = outp; | 3417 | mstm->outp = outp; |
| 3418 | mstm->mgr.cbs = &nv50_mstm; | 3418 | mstm->mgr.cbs = &nv50_mstm; |
| 3419 | 3419 | ||
| 3420 | ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev->dev, aux, aux_max, | 3420 | ret = drm_dp_mst_topology_mgr_init(&mstm->mgr, dev, aux, aux_max, |
| 3421 | max_payloads, conn_base_id); | 3421 | max_payloads, conn_base_id); |
| 3422 | if (ret) | 3422 | if (ret) |
| 3423 | return ret; | 3423 | return ret; |
diff --git a/drivers/gpu/drm/omapdrm/omap_debugfs.c b/drivers/gpu/drm/omapdrm/omap_debugfs.c index bf65862daf62..19b716745623 100644 --- a/drivers/gpu/drm/omapdrm/omap_debugfs.c +++ b/drivers/gpu/drm/omapdrm/omap_debugfs.c | |||
| @@ -123,13 +123,4 @@ int omap_debugfs_init(struct drm_minor *minor) | |||
| 123 | return ret; | 123 | return ret; |
| 124 | } | 124 | } |
| 125 | 125 | ||
| 126 | void omap_debugfs_cleanup(struct drm_minor *minor) | ||
| 127 | { | ||
| 128 | drm_debugfs_remove_files(omap_debugfs_list, | ||
| 129 | ARRAY_SIZE(omap_debugfs_list), minor); | ||
| 130 | if (dmm_is_available()) | ||
| 131 | drm_debugfs_remove_files(omap_dmm_debugfs_list, | ||
| 132 | ARRAY_SIZE(omap_dmm_debugfs_list), minor); | ||
| 133 | } | ||
| 134 | |||
| 135 | #endif | 126 | #endif |
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c index 00aa214b7560..afe8f05b927b 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.c +++ b/drivers/gpu/drm/omapdrm/omap_drv.c | |||
| @@ -719,7 +719,6 @@ static struct drm_driver omap_drm_driver = { | |||
| 719 | .disable_vblank = omap_irq_disable_vblank, | 719 | .disable_vblank = omap_irq_disable_vblank, |
| 720 | #ifdef CONFIG_DEBUG_FS | 720 | #ifdef CONFIG_DEBUG_FS |
| 721 | .debugfs_init = omap_debugfs_init, | 721 | .debugfs_init = omap_debugfs_init, |
| 722 | .debugfs_cleanup = omap_debugfs_cleanup, | ||
| 723 | #endif | 722 | #endif |
| 724 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, | 723 | .prime_handle_to_fd = drm_gem_prime_handle_to_fd, |
| 725 | .prime_fd_to_handle = drm_gem_prime_fd_to_handle, | 724 | .prime_fd_to_handle = drm_gem_prime_fd_to_handle, |
diff --git a/drivers/gpu/drm/omapdrm/omap_drv.h b/drivers/gpu/drm/omapdrm/omap_drv.h index b20377efd01b..36d93ce84a29 100644 --- a/drivers/gpu/drm/omapdrm/omap_drv.h +++ b/drivers/gpu/drm/omapdrm/omap_drv.h | |||
| @@ -103,7 +103,6 @@ struct omap_drm_private { | |||
| 103 | 103 | ||
| 104 | #ifdef CONFIG_DEBUG_FS | 104 | #ifdef CONFIG_DEBUG_FS |
| 105 | int omap_debugfs_init(struct drm_minor *minor); | 105 | int omap_debugfs_init(struct drm_minor *minor); |
| 106 | void omap_debugfs_cleanup(struct drm_minor *minor); | ||
| 107 | void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); | 106 | void omap_framebuffer_describe(struct drm_framebuffer *fb, struct seq_file *m); |
| 108 | void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m); | 107 | void omap_gem_describe(struct drm_gem_object *obj, struct seq_file *m); |
| 109 | void omap_gem_describe_objects(struct list_head *list, struct seq_file *m); | 108 | void omap_gem_describe_objects(struct list_head *list, struct seq_file *m); |
diff --git a/drivers/gpu/drm/radeon/radeon_cs.c b/drivers/gpu/drm/radeon/radeon_cs.c index 510ea371dacc..a8442f7196d6 100644 --- a/drivers/gpu/drm/radeon/radeon_cs.c +++ b/drivers/gpu/drm/radeon/radeon_cs.c | |||
| @@ -121,7 +121,8 @@ static int radeon_cs_parser_relocs(struct radeon_cs_parser *p) | |||
| 121 | VRAM, also but everything into VRAM on AGP cards and older | 121 | VRAM, also but everything into VRAM on AGP cards and older |
| 122 | IGP chips to avoid image corruptions */ | 122 | IGP chips to avoid image corruptions */ |
| 123 | if (p->ring == R600_RING_TYPE_UVD_INDEX && | 123 | if (p->ring == R600_RING_TYPE_UVD_INDEX && |
| 124 | (i == 0 || drm_pci_device_is_agp(p->rdev->ddev) || | 124 | (i == 0 || pci_find_capability(p->rdev->ddev->pdev, |
| 125 | PCI_CAP_ID_AGP) || | ||
| 125 | p->rdev->family == CHIP_RS780 || | 126 | p->rdev->family == CHIP_RS780 || |
| 126 | p->rdev->family == CHIP_RS880)) { | 127 | p->rdev->family == CHIP_RS880)) { |
| 127 | 128 | ||
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c index 8a1df2a1afbd..4b0c388be3f5 100644 --- a/drivers/gpu/drm/radeon/radeon_device.c +++ b/drivers/gpu/drm/radeon/radeon_device.c | |||
| @@ -1549,8 +1549,6 @@ failed: | |||
| 1549 | return r; | 1549 | return r; |
| 1550 | } | 1550 | } |
| 1551 | 1551 | ||
| 1552 | static void radeon_debugfs_remove_files(struct radeon_device *rdev); | ||
| 1553 | |||
| 1554 | /** | 1552 | /** |
| 1555 | * radeon_device_fini - tear down the driver | 1553 | * radeon_device_fini - tear down the driver |
| 1556 | * | 1554 | * |
| @@ -1577,7 +1575,6 @@ void radeon_device_fini(struct radeon_device *rdev) | |||
| 1577 | rdev->rmmio = NULL; | 1575 | rdev->rmmio = NULL; |
| 1578 | if (rdev->family >= CHIP_BONAIRE) | 1576 | if (rdev->family >= CHIP_BONAIRE) |
| 1579 | radeon_doorbell_fini(rdev); | 1577 | radeon_doorbell_fini(rdev); |
| 1580 | radeon_debugfs_remove_files(rdev); | ||
| 1581 | } | 1578 | } |
| 1582 | 1579 | ||
| 1583 | 1580 | ||
| @@ -1954,16 +1951,3 @@ int radeon_debugfs_add_files(struct radeon_device *rdev, | |||
| 1954 | #endif | 1951 | #endif |
| 1955 | return 0; | 1952 | return 0; |
| 1956 | } | 1953 | } |
| 1957 | |||
| 1958 | static void radeon_debugfs_remove_files(struct radeon_device *rdev) | ||
| 1959 | { | ||
| 1960 | #if defined(CONFIG_DEBUG_FS) | ||
| 1961 | unsigned i; | ||
| 1962 | |||
| 1963 | for (i = 0; i < rdev->debugfs_count; i++) { | ||
| 1964 | drm_debugfs_remove_files(rdev->debugfs[i].files, | ||
| 1965 | rdev->debugfs[i].num_files, | ||
| 1966 | rdev->ddev->primary); | ||
| 1967 | } | ||
| 1968 | #endif | ||
| 1969 | } | ||
diff --git a/drivers/gpu/drm/radeon/radeon_dp_mst.c b/drivers/gpu/drm/radeon/radeon_dp_mst.c index 6d1237d6e1b8..7d5ada3980dc 100644 --- a/drivers/gpu/drm/radeon/radeon_dp_mst.c +++ b/drivers/gpu/drm/radeon/radeon_dp_mst.c | |||
| @@ -667,7 +667,7 @@ radeon_dp_mst_init(struct radeon_connector *radeon_connector) | |||
| 667 | return 0; | 667 | return 0; |
| 668 | 668 | ||
| 669 | radeon_connector->mst_mgr.cbs = &mst_cbs; | 669 | radeon_connector->mst_mgr.cbs = &mst_cbs; |
| 670 | return drm_dp_mst_topology_mgr_init(&radeon_connector->mst_mgr, dev->dev, | 670 | return drm_dp_mst_topology_mgr_init(&radeon_connector->mst_mgr, dev, |
| 671 | &radeon_connector->ddc_bus->aux, 16, 6, | 671 | &radeon_connector->ddc_bus->aux, 16, 6, |
| 672 | radeon_connector->base.base.id); | 672 | radeon_connector->base.base.id); |
| 673 | } | 673 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 116cf0d23595..56f35c06742c 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
| @@ -105,7 +105,7 @@ int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags) | |||
| 105 | dev->dev_private = (void *)rdev; | 105 | dev->dev_private = (void *)rdev; |
| 106 | 106 | ||
| 107 | /* update BUS flag */ | 107 | /* update BUS flag */ |
| 108 | if (drm_pci_device_is_agp(dev)) { | 108 | if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP)) { |
| 109 | flags |= RADEON_IS_AGP; | 109 | flags |= RADEON_IS_AGP; |
| 110 | } else if (pci_is_pcie(dev->pdev)) { | 110 | } else if (pci_is_pcie(dev->pdev)) { |
| 111 | flags |= RADEON_IS_PCIE; | 111 | flags |= RADEON_IS_PCIE; |
diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c index 278a63f10d9f..acc056644cd0 100644 --- a/drivers/gpu/drm/sti/sti_drv.c +++ b/drivers/gpu/drm/sti/sti_drv.c | |||
| @@ -89,38 +89,9 @@ static struct drm_info_list sti_drm_dbg_list[] = { | |||
| 89 | {"fps_get", sti_drm_fps_dbg_show, 0}, | 89 | {"fps_get", sti_drm_fps_dbg_show, 0}, |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | static int sti_drm_debugfs_create(struct dentry *root, | ||
| 93 | struct drm_minor *minor, | ||
| 94 | const char *name, | ||
| 95 | const struct file_operations *fops) | ||
| 96 | { | ||
| 97 | struct drm_device *dev = minor->dev; | ||
| 98 | struct drm_info_node *node; | ||
| 99 | struct dentry *ent; | ||
| 100 | |||
| 101 | ent = debugfs_create_file(name, S_IRUGO | S_IWUSR, root, dev, fops); | ||
| 102 | if (IS_ERR(ent)) | ||
| 103 | return PTR_ERR(ent); | ||
| 104 | |||
| 105 | node = kmalloc(sizeof(*node), GFP_KERNEL); | ||
| 106 | if (!node) { | ||
| 107 | debugfs_remove(ent); | ||
| 108 | return -ENOMEM; | ||
| 109 | } | ||
| 110 | |||
| 111 | node->minor = minor; | ||
| 112 | node->dent = ent; | ||
| 113 | node->info_ent = (void *)fops; | ||
| 114 | |||
| 115 | mutex_lock(&minor->debugfs_lock); | ||
| 116 | list_add(&node->list, &minor->debugfs_list); | ||
| 117 | mutex_unlock(&minor->debugfs_lock); | ||
| 118 | |||
| 119 | return 0; | ||
| 120 | } | ||
| 121 | |||
| 122 | static int sti_drm_dbg_init(struct drm_minor *minor) | 92 | static int sti_drm_dbg_init(struct drm_minor *minor) |
| 123 | { | 93 | { |
| 94 | struct dentry *dentry; | ||
| 124 | int ret; | 95 | int ret; |
| 125 | 96 | ||
| 126 | ret = drm_debugfs_create_files(sti_drm_dbg_list, | 97 | ret = drm_debugfs_create_files(sti_drm_dbg_list, |
| @@ -129,10 +100,13 @@ static int sti_drm_dbg_init(struct drm_minor *minor) | |||
| 129 | if (ret) | 100 | if (ret) |
| 130 | goto err; | 101 | goto err; |
| 131 | 102 | ||
| 132 | ret = sti_drm_debugfs_create(minor->debugfs_root, minor, "fps_show", | 103 | dentry = debugfs_create_file("fps_show", S_IRUGO | S_IWUSR, |
| 104 | minor->debugfs_root, minor->dev, | ||
| 133 | &sti_drm_fps_fops); | 105 | &sti_drm_fps_fops); |
| 134 | if (ret) | 106 | if (!dentry) { |
| 107 | ret = -ENOMEM; | ||
| 135 | goto err; | 108 | goto err; |
| 109 | } | ||
| 136 | 110 | ||
| 137 | DRM_INFO("%s: debugfs installed\n", DRIVER_NAME); | 111 | DRM_INFO("%s: debugfs installed\n", DRIVER_NAME); |
| 138 | return 0; | 112 | return 0; |
| @@ -141,15 +115,6 @@ err: | |||
| 141 | return ret; | 115 | return ret; |
| 142 | } | 116 | } |
| 143 | 117 | ||
| 144 | static void sti_drm_dbg_cleanup(struct drm_minor *minor) | ||
| 145 | { | ||
| 146 | drm_debugfs_remove_files(sti_drm_dbg_list, | ||
| 147 | ARRAY_SIZE(sti_drm_dbg_list), minor); | ||
| 148 | |||
| 149 | drm_debugfs_remove_files((struct drm_info_list *)&sti_drm_fps_fops, | ||
| 150 | 1, minor); | ||
| 151 | } | ||
| 152 | |||
| 153 | static void sti_atomic_schedule(struct sti_private *private, | 118 | static void sti_atomic_schedule(struct sti_private *private, |
| 154 | struct drm_atomic_state *state) | 119 | struct drm_atomic_state *state) |
| 155 | { | 120 | { |
| @@ -314,7 +279,6 @@ static struct drm_driver sti_driver = { | |||
| 314 | .gem_prime_mmap = drm_gem_cma_prime_mmap, | 279 | .gem_prime_mmap = drm_gem_cma_prime_mmap, |
| 315 | 280 | ||
| 316 | .debugfs_init = sti_drm_dbg_init, | 281 | .debugfs_init = sti_drm_dbg_init, |
| 317 | .debugfs_cleanup = sti_drm_dbg_cleanup, | ||
| 318 | 282 | ||
| 319 | .name = DRIVER_NAME, | 283 | .name = DRIVER_NAME, |
| 320 | .desc = DRIVER_DESC, | 284 | .desc = DRIVER_DESC, |
diff --git a/drivers/gpu/drm/sti/sti_dvo.c b/drivers/gpu/drm/sti/sti_dvo.c index 411dc6ec976e..bb23318a44b7 100644 --- a/drivers/gpu/drm/sti/sti_dvo.c +++ b/drivers/gpu/drm/sti/sti_dvo.c | |||
| @@ -195,13 +195,6 @@ static struct drm_info_list dvo_debugfs_files[] = { | |||
| 195 | { "dvo", dvo_dbg_show, 0, NULL }, | 195 | { "dvo", dvo_dbg_show, 0, NULL }, |
| 196 | }; | 196 | }; |
| 197 | 197 | ||
| 198 | static void dvo_debugfs_exit(struct sti_dvo *dvo, struct drm_minor *minor) | ||
| 199 | { | ||
| 200 | drm_debugfs_remove_files(dvo_debugfs_files, | ||
| 201 | ARRAY_SIZE(dvo_debugfs_files), | ||
| 202 | minor); | ||
| 203 | } | ||
| 204 | |||
| 205 | static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor) | 198 | static int dvo_debugfs_init(struct sti_dvo *dvo, struct drm_minor *minor) |
| 206 | { | 199 | { |
| 207 | unsigned int i; | 200 | unsigned int i; |
| @@ -514,9 +507,6 @@ static void sti_dvo_unbind(struct device *dev, | |||
| 514 | struct device *master, void *data) | 507 | struct device *master, void *data) |
| 515 | { | 508 | { |
| 516 | struct sti_dvo *dvo = dev_get_drvdata(dev); | 509 | struct sti_dvo *dvo = dev_get_drvdata(dev); |
| 517 | struct drm_device *drm_dev = data; | ||
| 518 | |||
| 519 | dvo_debugfs_exit(dvo, drm_dev->primary); | ||
| 520 | 510 | ||
| 521 | drm_bridge_remove(dvo->bridge); | 511 | drm_bridge_remove(dvo->bridge); |
| 522 | } | 512 | } |
diff --git a/drivers/gpu/drm/sti/sti_hda.c b/drivers/gpu/drm/sti/sti_hda.c index 66d37d78152a..0c0a75bc8bc3 100644 --- a/drivers/gpu/drm/sti/sti_hda.c +++ b/drivers/gpu/drm/sti/sti_hda.c | |||
| @@ -365,13 +365,6 @@ static struct drm_info_list hda_debugfs_files[] = { | |||
| 365 | { "hda", hda_dbg_show, 0, NULL }, | 365 | { "hda", hda_dbg_show, 0, NULL }, |
| 366 | }; | 366 | }; |
| 367 | 367 | ||
| 368 | static void hda_debugfs_exit(struct sti_hda *hda, struct drm_minor *minor) | ||
| 369 | { | ||
| 370 | drm_debugfs_remove_files(hda_debugfs_files, | ||
| 371 | ARRAY_SIZE(hda_debugfs_files), | ||
| 372 | minor); | ||
| 373 | } | ||
| 374 | |||
| 375 | static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor) | 368 | static int hda_debugfs_init(struct sti_hda *hda, struct drm_minor *minor) |
| 376 | { | 369 | { |
| 377 | unsigned int i; | 370 | unsigned int i; |
| @@ -739,10 +732,6 @@ err_sysfs: | |||
| 739 | static void sti_hda_unbind(struct device *dev, | 732 | static void sti_hda_unbind(struct device *dev, |
| 740 | struct device *master, void *data) | 733 | struct device *master, void *data) |
| 741 | { | 734 | { |
| 742 | struct sti_hda *hda = dev_get_drvdata(dev); | ||
| 743 | struct drm_device *drm_dev = data; | ||
| 744 | |||
| 745 | hda_debugfs_exit(hda, drm_dev->primary); | ||
| 746 | } | 735 | } |
| 747 | 736 | ||
| 748 | static const struct component_ops sti_hda_ops = { | 737 | static const struct component_ops sti_hda_ops = { |
diff --git a/drivers/gpu/drm/sti/sti_hdmi.c b/drivers/gpu/drm/sti/sti_hdmi.c index 5ef1d1fce6d1..c9151849d604 100644 --- a/drivers/gpu/drm/sti/sti_hdmi.c +++ b/drivers/gpu/drm/sti/sti_hdmi.c | |||
| @@ -731,13 +731,6 @@ static struct drm_info_list hdmi_debugfs_files[] = { | |||
| 731 | { "hdmi", hdmi_dbg_show, 0, NULL }, | 731 | { "hdmi", hdmi_dbg_show, 0, NULL }, |
| 732 | }; | 732 | }; |
| 733 | 733 | ||
| 734 | static void hdmi_debugfs_exit(struct sti_hdmi *hdmi, struct drm_minor *minor) | ||
| 735 | { | ||
| 736 | drm_debugfs_remove_files(hdmi_debugfs_files, | ||
| 737 | ARRAY_SIZE(hdmi_debugfs_files), | ||
| 738 | minor); | ||
| 739 | } | ||
| 740 | |||
| 741 | static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor) | 734 | static int hdmi_debugfs_init(struct sti_hdmi *hdmi, struct drm_minor *minor) |
| 742 | { | 735 | { |
| 743 | unsigned int i; | 736 | unsigned int i; |
| @@ -1356,10 +1349,6 @@ err_sysfs: | |||
| 1356 | static void sti_hdmi_unbind(struct device *dev, | 1349 | static void sti_hdmi_unbind(struct device *dev, |
| 1357 | struct device *master, void *data) | 1350 | struct device *master, void *data) |
| 1358 | { | 1351 | { |
| 1359 | struct sti_hdmi *hdmi = dev_get_drvdata(dev); | ||
| 1360 | struct drm_device *drm_dev = data; | ||
| 1361 | |||
| 1362 | hdmi_debugfs_exit(hdmi, drm_dev->primary); | ||
| 1363 | } | 1352 | } |
| 1364 | 1353 | ||
| 1365 | static const struct component_ops sti_hdmi_ops = { | 1354 | static const struct component_ops sti_hdmi_ops = { |
diff --git a/drivers/gpu/drm/sti/sti_tvout.c b/drivers/gpu/drm/sti/sti_tvout.c index ad46d3558d91..8b8ea717c121 100644 --- a/drivers/gpu/drm/sti/sti_tvout.c +++ b/drivers/gpu/drm/sti/sti_tvout.c | |||
| @@ -567,13 +567,6 @@ static struct drm_info_list tvout_debugfs_files[] = { | |||
| 567 | { "tvout", tvout_dbg_show, 0, NULL }, | 567 | { "tvout", tvout_dbg_show, 0, NULL }, |
| 568 | }; | 568 | }; |
| 569 | 569 | ||
| 570 | static void tvout_debugfs_exit(struct sti_tvout *tvout, struct drm_minor *minor) | ||
| 571 | { | ||
| 572 | drm_debugfs_remove_files(tvout_debugfs_files, | ||
| 573 | ARRAY_SIZE(tvout_debugfs_files), | ||
| 574 | minor); | ||
| 575 | } | ||
| 576 | |||
| 577 | static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor) | 570 | static int tvout_debugfs_init(struct sti_tvout *tvout, struct drm_minor *minor) |
| 578 | { | 571 | { |
| 579 | unsigned int i; | 572 | unsigned int i; |
| @@ -627,7 +620,6 @@ static void sti_tvout_early_unregister(struct drm_encoder *encoder) | |||
| 627 | if (!tvout->debugfs_registered) | 620 | if (!tvout->debugfs_registered) |
| 628 | return; | 621 | return; |
| 629 | 622 | ||
| 630 | tvout_debugfs_exit(tvout, encoder->dev->primary); | ||
| 631 | tvout->debugfs_registered = false; | 623 | tvout->debugfs_registered = false; |
| 632 | } | 624 | } |
| 633 | 625 | ||
diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c index 2d57f6278db1..ef215fef63d6 100644 --- a/drivers/gpu/drm/tegra/drm.c +++ b/drivers/gpu/drm/tegra/drm.c | |||
| @@ -894,12 +894,6 @@ static int tegra_debugfs_init(struct drm_minor *minor) | |||
| 894 | ARRAY_SIZE(tegra_debugfs_list), | 894 | ARRAY_SIZE(tegra_debugfs_list), |
| 895 | minor->debugfs_root, minor); | 895 | minor->debugfs_root, minor); |
| 896 | } | 896 | } |
| 897 | |||
| 898 | static void tegra_debugfs_cleanup(struct drm_minor *minor) | ||
| 899 | { | ||
| 900 | drm_debugfs_remove_files(tegra_debugfs_list, | ||
| 901 | ARRAY_SIZE(tegra_debugfs_list), minor); | ||
| 902 | } | ||
| 903 | #endif | 897 | #endif |
| 904 | 898 | ||
| 905 | static struct drm_driver tegra_drm_driver = { | 899 | static struct drm_driver tegra_drm_driver = { |
| @@ -917,7 +911,6 @@ static struct drm_driver tegra_drm_driver = { | |||
| 917 | 911 | ||
| 918 | #if defined(CONFIG_DEBUG_FS) | 912 | #if defined(CONFIG_DEBUG_FS) |
| 919 | .debugfs_init = tegra_debugfs_init, | 913 | .debugfs_init = tegra_debugfs_init, |
| 920 | .debugfs_cleanup = tegra_debugfs_cleanup, | ||
| 921 | #endif | 914 | #endif |
| 922 | 915 | ||
| 923 | .gem_free_object_unlocked = tegra_bo_free_object, | 916 | .gem_free_object_unlocked = tegra_bo_free_object, |
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.c b/drivers/gpu/drm/tilcdc/tilcdc_drv.c index ec15585c7a27..919294a735fe 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.c +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.c | |||
| @@ -539,17 +539,6 @@ static int tilcdc_debugfs_init(struct drm_minor *minor) | |||
| 539 | 539 | ||
| 540 | return ret; | 540 | return ret; |
| 541 | } | 541 | } |
| 542 | |||
| 543 | static void tilcdc_debugfs_cleanup(struct drm_minor *minor) | ||
| 544 | { | ||
| 545 | struct tilcdc_module *mod; | ||
| 546 | drm_debugfs_remove_files(tilcdc_debugfs_list, | ||
| 547 | ARRAY_SIZE(tilcdc_debugfs_list), minor); | ||
| 548 | |||
| 549 | list_for_each_entry(mod, &module_list, list) | ||
| 550 | if (mod->funcs->debugfs_cleanup) | ||
| 551 | mod->funcs->debugfs_cleanup(mod, minor); | ||
| 552 | } | ||
| 553 | #endif | 542 | #endif |
| 554 | 543 | ||
| 555 | static const struct file_operations fops = { | 544 | static const struct file_operations fops = { |
| @@ -589,7 +578,6 @@ static struct drm_driver tilcdc_driver = { | |||
| 589 | .gem_prime_mmap = drm_gem_cma_prime_mmap, | 578 | .gem_prime_mmap = drm_gem_cma_prime_mmap, |
| 590 | #ifdef CONFIG_DEBUG_FS | 579 | #ifdef CONFIG_DEBUG_FS |
| 591 | .debugfs_init = tilcdc_debugfs_init, | 580 | .debugfs_init = tilcdc_debugfs_init, |
| 592 | .debugfs_cleanup = tilcdc_debugfs_cleanup, | ||
| 593 | #endif | 581 | #endif |
| 594 | .fops = &fops, | 582 | .fops = &fops, |
| 595 | .name = "tilcdc", | 583 | .name = "tilcdc", |
diff --git a/drivers/gpu/drm/tilcdc/tilcdc_drv.h b/drivers/gpu/drm/tilcdc/tilcdc_drv.h index 0e71daf5b5cb..8caa11bc7aec 100644 --- a/drivers/gpu/drm/tilcdc/tilcdc_drv.h +++ b/drivers/gpu/drm/tilcdc/tilcdc_drv.h | |||
| @@ -111,8 +111,6 @@ struct tilcdc_module_ops { | |||
| 111 | #ifdef CONFIG_DEBUG_FS | 111 | #ifdef CONFIG_DEBUG_FS |
| 112 | /* create debugfs nodes (can be NULL): */ | 112 | /* create debugfs nodes (can be NULL): */ |
| 113 | int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor); | 113 | int (*debugfs_init)(struct tilcdc_module *mod, struct drm_minor *minor); |
| 114 | /* cleanup debugfs nodes (can be NULL): */ | ||
| 115 | void (*debugfs_cleanup)(struct tilcdc_module *mod, struct drm_minor *minor); | ||
| 116 | #endif | 114 | #endif |
| 117 | }; | 115 | }; |
| 118 | 116 | ||
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index d5063618efa7..86e3b233b722 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c | |||
| @@ -1670,7 +1670,6 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) | |||
| 1670 | struct ttm_buffer_object *bo; | 1670 | struct ttm_buffer_object *bo; |
| 1671 | int ret = -EBUSY; | 1671 | int ret = -EBUSY; |
| 1672 | int put_count; | 1672 | int put_count; |
| 1673 | uint32_t swap_placement = (TTM_PL_FLAG_CACHED | TTM_PL_FLAG_SYSTEM); | ||
| 1674 | 1673 | ||
| 1675 | spin_lock(&glob->lru_lock); | 1674 | spin_lock(&glob->lru_lock); |
| 1676 | list_for_each_entry(bo, &glob->swap_lru, swap) { | 1675 | list_for_each_entry(bo, &glob->swap_lru, swap) { |
| @@ -1701,7 +1700,8 @@ static int ttm_bo_swapout(struct ttm_mem_shrink *shrink) | |||
| 1701 | * Move to system cached | 1700 | * Move to system cached |
| 1702 | */ | 1701 | */ |
| 1703 | 1702 | ||
| 1704 | if ((bo->mem.placement & swap_placement) != swap_placement) { | 1703 | if (bo->mem.mem_type != TTM_PL_SYSTEM || |
| 1704 | bo->ttm->caching_state != tt_cached) { | ||
| 1705 | struct ttm_mem_reg evict_mem; | 1705 | struct ttm_mem_reg evict_mem; |
| 1706 | 1706 | ||
| 1707 | evict_mem = bo->mem; | 1707 | evict_mem = bo->mem; |
diff --git a/drivers/gpu/drm/vc4/vc4_debugfs.c b/drivers/gpu/drm/vc4/vc4_debugfs.c index caf817bac885..c4d5e6a8d6f2 100644 --- a/drivers/gpu/drm/vc4/vc4_debugfs.c +++ b/drivers/gpu/drm/vc4/vc4_debugfs.c | |||
| @@ -36,9 +36,3 @@ vc4_debugfs_init(struct drm_minor *minor) | |||
| 36 | return drm_debugfs_create_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES, | 36 | return drm_debugfs_create_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES, |
| 37 | minor->debugfs_root, minor); | 37 | minor->debugfs_root, minor); |
| 38 | } | 38 | } |
| 39 | |||
| 40 | void | ||
| 41 | vc4_debugfs_cleanup(struct drm_minor *minor) | ||
| 42 | { | ||
| 43 | drm_debugfs_remove_files(vc4_debugfs_list, VC4_DEBUGFS_ENTRIES, minor); | ||
| 44 | } | ||
diff --git a/drivers/gpu/drm/vc4/vc4_drv.c b/drivers/gpu/drm/vc4/vc4_drv.c index ac09ca7ff430..e4f42ebee517 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.c +++ b/drivers/gpu/drm/vc4/vc4_drv.c | |||
| @@ -145,7 +145,6 @@ static struct drm_driver vc4_drm_driver = { | |||
| 145 | 145 | ||
| 146 | #if defined(CONFIG_DEBUG_FS) | 146 | #if defined(CONFIG_DEBUG_FS) |
| 147 | .debugfs_init = vc4_debugfs_init, | 147 | .debugfs_init = vc4_debugfs_init, |
| 148 | .debugfs_cleanup = vc4_debugfs_cleanup, | ||
| 149 | #endif | 148 | #endif |
| 150 | 149 | ||
| 151 | .gem_create_object = vc4_create_object, | 150 | .gem_create_object = vc4_create_object, |
diff --git a/drivers/gpu/drm/vc4/vc4_drv.h b/drivers/gpu/drm/vc4/vc4_drv.h index affcdeb70aa9..78e3e5a43fb0 100644 --- a/drivers/gpu/drm/vc4/vc4_drv.h +++ b/drivers/gpu/drm/vc4/vc4_drv.h | |||
| @@ -457,7 +457,6 @@ int vc4_crtc_get_vblank_timestamp(struct drm_device *dev, unsigned int crtc_id, | |||
| 457 | 457 | ||
| 458 | /* vc4_debugfs.c */ | 458 | /* vc4_debugfs.c */ |
| 459 | int vc4_debugfs_init(struct drm_minor *minor); | 459 | int vc4_debugfs_init(struct drm_minor *minor); |
| 460 | void vc4_debugfs_cleanup(struct drm_minor *minor); | ||
| 461 | 460 | ||
| 462 | /* vc4_drv.c */ | 461 | /* vc4_drv.c */ |
| 463 | void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); | 462 | void __iomem *vc4_ioremap_regs(struct platform_device *dev, int index); |
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index c4cb2e26de32..93d5994f3a04 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c | |||
| @@ -356,15 +356,11 @@ static void vc4_hdmi_set_avi_infoframe(struct drm_encoder *encoder) | |||
| 356 | return; | 356 | return; |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | if (vc4_encoder->rgb_range_selectable) { | 359 | drm_hdmi_avi_infoframe_quant_range(&frame.avi, mode, |
| 360 | if (vc4_encoder->limited_rgb_range) { | 360 | vc4_encoder->limited_rgb_range ? |
| 361 | frame.avi.quantization_range = | 361 | HDMI_QUANTIZATION_RANGE_LIMITED : |
| 362 | HDMI_QUANTIZATION_RANGE_LIMITED; | 362 | HDMI_QUANTIZATION_RANGE_FULL, |
| 363 | } else { | 363 | vc4_encoder->rgb_range_selectable); |
| 364 | frame.avi.quantization_range = | ||
| 365 | HDMI_QUANTIZATION_RANGE_FULL; | ||
| 366 | } | ||
| 367 | } | ||
| 368 | 364 | ||
| 369 | vc4_hdmi_write_infoframe(encoder, &frame); | 365 | vc4_hdmi_write_infoframe(encoder, &frame); |
| 370 | } | 366 | } |
| @@ -463,7 +459,9 @@ static void vc4_hdmi_encoder_mode_set(struct drm_encoder *encoder, | |||
| 463 | csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, | 459 | csc_ctl = VC4_SET_FIELD(VC4_HD_CSC_CTL_ORDER_BGR, |
| 464 | VC4_HD_CSC_CTL_ORDER); | 460 | VC4_HD_CSC_CTL_ORDER); |
| 465 | 461 | ||
| 466 | if (vc4_encoder->hdmi_monitor && drm_match_cea_mode(mode) > 1) { | 462 | if (vc4_encoder->hdmi_monitor && |
| 463 | drm_default_rgb_quant_range(mode) == | ||
| 464 | HDMI_QUANTIZATION_RANGE_LIMITED) { | ||
| 467 | /* CEA VICs other than #1 requre limited range RGB | 465 | /* CEA VICs other than #1 requre limited range RGB |
| 468 | * output unless overridden by an AVI infoframe. | 466 | * output unless overridden by an AVI infoframe. |
| 469 | * Apply a colorspace conversion to squash 0-255 down | 467 | * Apply a colorspace conversion to squash 0-255 down |
diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index da25dfe7b80e..3109c8308eb5 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c | |||
| @@ -190,12 +190,12 @@ int vgem_fence_attach_ioctl(struct drm_device *dev, | |||
| 190 | 190 | ||
| 191 | /* Expose the fence via the dma-buf */ | 191 | /* Expose the fence via the dma-buf */ |
| 192 | ret = 0; | 192 | ret = 0; |
| 193 | ww_mutex_lock(&resv->lock, NULL); | 193 | reservation_object_lock(resv, NULL); |
| 194 | if (arg->flags & VGEM_FENCE_WRITE) | 194 | if (arg->flags & VGEM_FENCE_WRITE) |
| 195 | reservation_object_add_excl_fence(resv, fence); | 195 | reservation_object_add_excl_fence(resv, fence); |
| 196 | else if ((ret = reservation_object_reserve_shared(resv)) == 0) | 196 | else if ((ret = reservation_object_reserve_shared(resv)) == 0) |
| 197 | reservation_object_add_shared_fence(resv, fence); | 197 | reservation_object_add_shared_fence(resv, fence); |
| 198 | ww_mutex_unlock(&resv->lock); | 198 | reservation_object_unlock(resv); |
| 199 | 199 | ||
| 200 | /* Record the fence in our idr for later signaling */ | 200 | /* Record the fence in our idr for later signaling */ |
| 201 | if (ret == 0) { | 201 | if (ret == 0) { |
