drm/shmem: Put pages independent of a SG table being set
authorRob Herring <robh@kernel.org>
Fri, 19 Jul 2019 14:30:12 +0000 (08:30 -0600)
committerRob Herring <robh@kernel.org>
Mon, 12 Aug 2019 20:18:42 +0000 (14:18 -0600)
commit3bf5189d93d04519e93e16bf3aa60589e136c666
tree6289ed23957d026c1d5c43f2b9053c329c13f05c
parent930a402485b205214231f1141632afdca8ff89cb
drm/shmem: Put pages independent of a SG table being set

If a driver does its own management of pages, the shmem helper object's
pages array could be allocated when a SG table is not. There's not
really any  good reason to tie putting pages with having a SG table when
freeing the object, so just put pages if the pages array is populated.

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>
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-3-robh@kernel.org
drivers/gpu/drm/drm_gem_shmem_helper.c