video: tegra: nvmap: Fix build for Linux v6.12

In Linux v6.12, commit ("4ffca5a96678 mm: support only one page_type per
page") removed the definition PAGE_MAPCOUNT_RESERVE and this breaks the
build for NVMAP. The function 'page_has_type()' was added in Linux v5.0
and performs the necessary check and so use this instead to fix the
build.

Bug 4593750

Change-Id: Iaa7393ae11de9730b4ec876a971223e62a7f3f7d
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3217428
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2024-09-11 14:00:44 +01:00
parent 68321dfd20
commit c69cddda5d

View File

@@ -784,7 +784,7 @@ static int nvmap_page_mapcount(struct page *page)
int mapcount = atomic_read(&page->_mapcount) + 1; int mapcount = atomic_read(&page->_mapcount) + 1;
/* Handle page_has_type() pages */ /* Handle page_has_type() pages */
if (mapcount < PAGE_MAPCOUNT_RESERVE + 1) if (page_has_type(page))
mapcount = 0; mapcount = 0;
if (unlikely(PageCompound(page))) if (unlikely(PageCompound(page)))
#if defined(NV_FOLIO_ENTIRE_MAPCOUNT_PRESENT) /* Linux v5.18 */ #if defined(NV_FOLIO_ENTIRE_MAPCOUNT_PRESENT) /* Linux v5.18 */