mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 10:11:26 +03:00
drm/tegra: Avoid kernel version checks
Instead of using kernel version checks in the Tegra DRM driver for the tegra_fb_ops structure, just check if the appropriate definition is defined and if so use it. This fixes building the Tegra DRM driver against some 3rd party kernels that include backports from upstream. Note that this also aligns the driver closer to the upstream code by using the same definitions that the upstream driver uses. Bug 4346767 Change-Id: I8cb40899d0bf7cdc233e5f4cee7b6afb6f12d015 Signed-off-by: Jon Hunter <jonathanh@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3027832 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
88e674112a
commit
086fc6d3da
@@ -11,10 +11,7 @@
|
||||
|
||||
#include <linux/console.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
|
||||
#include <linux/fb.h>
|
||||
#endif
|
||||
|
||||
#include <drm/drm_fourcc.h>
|
||||
#include <drm/drm_framebuffer.h>
|
||||
@@ -214,24 +211,21 @@ static int tegra_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
|
||||
return __tegra_gem_mmap(&bo->gem, vma);
|
||||
}
|
||||
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
|
||||
#if defined(NV_FB_DEFERRED_IO_OPS_RENAME)
|
||||
FB_GEN_DEFAULT_DEFERRED_IOMEM_OPS(tegra_fb,
|
||||
drm_fb_helper_damage_range,
|
||||
drm_fb_helper_damage_area)
|
||||
#else
|
||||
FB_GEN_DEFAULT_DEFERRED_IO_OPS(tegra_fb,
|
||||
drm_fb_helper_damage_range,
|
||||
drm_fb_helper_damage_area)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
static const struct fb_ops tegra_fb_ops = {
|
||||
.owner = THIS_MODULE,
|
||||
#if defined(__FB_DEFAULT_DMAMEM_OPS_RDWR) /* Linux v6.6 */
|
||||
__FB_DEFAULT_DMAMEM_OPS_RDWR,
|
||||
#elif defined(__FB_DEFAULT_SYS_OPS_RDWR) /* Linux v6.5 */
|
||||
__FB_DEFAULT_SYS_OPS_RDWR,
|
||||
#else
|
||||
.fb_read = drm_fb_helper_sys_read,
|
||||
.fb_write = drm_fb_helper_sys_write,
|
||||
#endif
|
||||
DRM_FB_HELPER_DEFAULT_OPS,
|
||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 5, 0)
|
||||
__FB_DEFAULT_DEFERRED_OPS_RDWR(tegra_fb),
|
||||
__FB_DEFAULT_DEFERRED_OPS_DRAW(tegra_fb),
|
||||
#if defined(__FB_DEFAULT_DMAMEM_OPS_DRAW) /* Linux v6.6 */
|
||||
__FB_DEFAULT_DMAMEM_OPS_DRAW,
|
||||
#elif defined(__FB_DEFAULT_SYS_OPS_DRAW) /* Linux v6.5 */
|
||||
__FB_DEFAULT_SYS_OPS_DRAW,
|
||||
#else
|
||||
.fb_fillrect = drm_fb_helper_sys_fillrect,
|
||||
.fb_copyarea = drm_fb_helper_sys_copyarea,
|
||||
|
||||
Reference in New Issue
Block a user