drivers: Use conftest for vm_flags

The conftest script has a test for checking if the vm_area struct has a
const vm_flags member. So enable this test and use the definition
generated in the appropriate drivers.

Bug 4374520

Change-Id: I0e7bd105fe8a821b0af23c0a5553b8d4468fa8c4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026924
(cherry picked from commit d0e427c6e1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3029982
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-12-02 16:40:32 +00:00
committed by mobile promotions
parent daec781815
commit a6701b19b9
5 changed files with 8 additions and 10 deletions

View File

@@ -584,8 +584,7 @@ int __tegra_gem_mmap(struct drm_gem_object *gem, struct vm_area_struct *vma)
* and set the vm_pgoff (used as a fake buffer offset by DRM)
* to 0 as we want to map the whole buffer.
*/
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) \
|| (defined(CONFIG_TEGRA_SYSTEM_TYPE_ACK) && (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)))
#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) /* Linux v6.3 */
vm_flags_clear(vma, VM_PFNMAP);
#else
vma->vm_flags &= ~VM_PFNMAP;
@@ -603,8 +602,7 @@ int __tegra_gem_mmap(struct drm_gem_object *gem, struct vm_area_struct *vma)
} else {
pgprot_t prot = vm_get_page_prot(vma->vm_flags);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0)) \
|| (defined(CONFIG_TEGRA_SYSTEM_TYPE_ACK) && (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)))
#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) /* Linux v6.3 */
vm_flags_set(vma, VM_MIXEDMAP);
vm_flags_clear(vma, VM_PFNMAP);
#else