On Wed, Apr 07, 2021 at 09:27:46AM +0800, songqiang wrote:
Please add the description in the commit message and subject.
Thanks, Ray
Signed-off-by: songqiang songqiang@uniontech.com
drivers/gpu/drm/ttm/ttm_page_alloc.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 14660f723f71..f3698f0ad4d7 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -736,8 +736,16 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags, if (++p != pages[i + j]) break;
if (j == HPAGE_PMD_NR)
if (j == HPAGE_PMD_NR) { order = HPAGE_PMD_ORDER;
for (j = 1; j < HPAGE_PMD_NR; ++j)
page_ref_dec(pages[i+j]);
} }
#endif
@@ -868,10 +876,12 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, p = alloc_pages(huge_flags, HPAGE_PMD_ORDER); if (!p) break;
for (j = 0; j < HPAGE_PMD_NR; ++j)
for (j = 0; j < HPAGE_PMD_NR; ++j) { pages[i++] = p++;
if (j > 0)
page_ref_inc(pages[i-1]);
}} npages -= HPAGE_PMD_NR; }
dri-devel mailing list dri-devel@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.free...