drm/gem: Allow sparsely populated page arrays in drm_gem_put_pages
authorRob Herring <robh@kernel.org>
Fri, 19 Jul 2019 14:28:51 +0000 (08:28 -0600)
committerRob Herring <robh@kernel.org>
Mon, 12 Aug 2019 20:17:09 +0000 (14:17 -0600)
commit930a402485b205214231f1141632afdca8ff89cb
tree32a6f595dd0fa387f1acf932d129ff59804c6869
parentac9fd659ef8cac9a71f0ef943ef6da04f1939775
drm/gem: Allow sparsely populated page arrays in drm_gem_put_pages

Panfrost has a need for pages allocated on demand via GPU page faults.
When releasing the pages, the only thing preventing using
drm_gem_put_pages() is needing to skip over unpopulated pages, so allow
for skipping over NULL struct page pointers.

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Reviewed-by: Steven Price <steven.price@arm.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20190808222200.13176-2-robh@kernel.org
drivers/gpu/drm/drm_gem.c