]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/i915 & drm/xe: save struct drm_device to drvdata
authorJani Nikula <jani.nikula@intel.com>
Thu, 29 Aug 2024 14:47:43 +0000 (17:47 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 2 Sep 2024 12:01:59 +0000 (15:01 +0300)
commit83e5af5997554115e198c2e9e97564702eac04a6
tree4bdf86e7887c51aa84c495f381764e7a1dcb2372
parent8be4dce5ea6f2368cc25edc71989c4690fa66964
drm/i915 & drm/xe: save struct drm_device to drvdata

In the future, the display code shall not have any idea about struct
xe_device or struct drm_i915_private, but will need to get at the struct
drm_device via drvdata. Store the struct drm_device pointer to drvdata
instead of the driver specific pointer.

Avoid passing NULL to container_of() via to_i915()/to_xe_device(). (It
does return NULL for NULL pointers when the offset happens to be 0, but
otherwise returns garbage pointers for NULL.)

Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/946805b32e38d4785880cc7857e01e6a309126a9.1724942754.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_driver.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/selftests/mock_gem_device.c
drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h
drivers/gpu/drm/xe/xe_device.h
drivers/gpu/drm/xe/xe_pci.c