mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-22 17:25:35 +03:00
drm/tegra: Fix aperture support for Linux v6.13
In Linux v6.13, commit 689274a56c0c ("drm: Remove DRM aperture helpers")
removed the DRM aperture helper functions and drivers should simply use
the existing video helpers. Update the Tegra DRM driver to use
aperture_remove_all_conflicting_devices() if available to align with
upstream.
Bug 4991705
Change-Id: Ie4b78a4ea519ffcaaf972417ec2cbe7c436eb808
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3261694
GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com>
Reviewed-by: Mikko Perttunen <mperttunen@nvidia.com>
This commit is contained in:
@@ -16,7 +16,11 @@
|
|||||||
#include <linux/pm_runtime.h>
|
#include <linux/pm_runtime.h>
|
||||||
#include <linux/version.h>
|
#include <linux/version.h>
|
||||||
|
|
||||||
|
#if defined(NV_APERTURE_REMOVE_ALL_CONFLICTING_DEVICES_PRESENT) /* Linux v6.0 */
|
||||||
|
#include <linux/aperture.h>
|
||||||
|
#else
|
||||||
#include <drm/drm_aperture.h>
|
#include <drm/drm_aperture.h>
|
||||||
|
#endif
|
||||||
#include <drm/drm_atomic.h>
|
#include <drm/drm_atomic.h>
|
||||||
#include <drm/drm_atomic_helper.h>
|
#include <drm/drm_atomic_helper.h>
|
||||||
#include <drm/drm_debugfs.h>
|
#include <drm/drm_debugfs.h>
|
||||||
@@ -1315,7 +1319,9 @@ static int host1x_drm_probe(struct host1x_device *dev)
|
|||||||
drm_mode_config_reset(drm);
|
drm_mode_config_reset(drm);
|
||||||
|
|
||||||
if (drm->mode_config.num_crtc > 0) {
|
if (drm->mode_config.num_crtc > 0) {
|
||||||
#if defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_NO_PRIMARY_ARG) /* Linux v6.5 */
|
#if defined(NV_APERTURE_REMOVE_ALL_CONFLICTING_DEVICES_PRESENT) /* Linux v6.0 */
|
||||||
|
err = aperture_remove_all_conflicting_devices(tegra_drm_driver.name);
|
||||||
|
#elif defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_NO_PRIMARY_ARG) /* Linux v6.5 */
|
||||||
err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
|
err = drm_aperture_remove_framebuffers(&tegra_drm_driver);
|
||||||
#elif defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_DRM_DRIVER_ARG) /* Linux v5.15 */
|
#elif defined(NV_DRM_APERTURE_REMOVE_FRAMEBUFFERS_HAS_DRM_DRIVER_ARG) /* Linux v5.15 */
|
||||||
err = drm_aperture_remove_framebuffers(false, &tegra_drm_driver);
|
err = drm_aperture_remove_framebuffers(false, &tegra_drm_driver);
|
||||||
|
|||||||
@@ -90,6 +90,7 @@ endef
|
|||||||
|
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += __alloc_disk_node_has_lkclass_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += __alloc_disk_node_has_lkclass_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += __assign_str_has_no_src_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += __assign_str_has_no_src_arg
|
||||||
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += aperture_remove_all_conflicting_devices
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_execute_rq_has_no_gendisk_arg
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_execute_rq_has_no_gendisk_arg
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_disk_for_queue
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_disk_for_queue
|
||||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_queue
|
NV_CONFTEST_FUNCTION_COMPILE_TESTS += blk_mq_alloc_queue
|
||||||
@@ -244,6 +245,7 @@ NV_HEADER_PRESENCE_TESTS = \
|
|||||||
drm/drm_dp_aux_bus.h \
|
drm/drm_dp_aux_bus.h \
|
||||||
drm/drm_eld.h \
|
drm/drm_eld.h \
|
||||||
generated/autoconf.h \
|
generated/autoconf.h \
|
||||||
|
linux/aperture.h \
|
||||||
linux/kconfig.h \
|
linux/kconfig.h \
|
||||||
linux/iosys-map.h \
|
linux/iosys-map.h \
|
||||||
linux/tegra_prod.h \
|
linux/tegra_prod.h \
|
||||||
|
|||||||
@@ -6534,6 +6534,28 @@ compile_test() {
|
|||||||
compile_check_conftest "$CODE" "NV___ALLOC_DISK_NODE_HAS_LKCLASS_ARG" "" "types"
|
compile_check_conftest "$CODE" "NV___ALLOC_DISK_NODE_HAS_LKCLASS_ARG" "" "types"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
aperture_remove_all_conflicting_devices)
|
||||||
|
#
|
||||||
|
# Determine if the function aperture_remove_all_conflicting_devices()
|
||||||
|
# is present.
|
||||||
|
#
|
||||||
|
# In Linux v6.0, commit 7283f862bd99 ("drm: Implement DRM aperture
|
||||||
|
# helpers under video/") added the function
|
||||||
|
# aperture_remove_all_conflicting_devices().
|
||||||
|
#
|
||||||
|
CODE="
|
||||||
|
#if defined(NV_LINUX_APERTURE_H_PRESENT)
|
||||||
|
#include <linux/aperture.h>
|
||||||
|
#else
|
||||||
|
#error \"linux/aperture.h not found!\"
|
||||||
|
#endif
|
||||||
|
void conftest_aperture_remove_all_conflicting_devices(const char *name) {
|
||||||
|
aperture_remove_all_conflicting_devices(name);
|
||||||
|
}"
|
||||||
|
|
||||||
|
compile_check_conftest "$CODE" "NV_APERTURE_REMOVE_ALL_CONFLICTING_DEVICES_PRESENT" "" "types"
|
||||||
|
;;
|
||||||
|
|
||||||
blk_execute_rq_has_no_gendisk_arg)
|
blk_execute_rq_has_no_gendisk_arg)
|
||||||
#
|
#
|
||||||
# Determine if the function blk_execute_rq() has an argument of
|
# Determine if the function blk_execute_rq() has an argument of
|
||||||
|
|||||||
Reference in New Issue
Block a user