summaryrefslogtreecommitdiff
path: root/hwcutils.cpp
diff options
context:
space:
mode:
authorRob Herring <robh@kernel.org>2017-10-06 17:20:05 -0500
committerRobert Foss <robert.foss@collabora.com>2017-10-09 14:36:19 +0200
commitaeccd89eaafec467cb9449cce5c64152a240c138 (patch)
tree912540af41097f2f7117ad09d81732b0d0a97e1d /hwcutils.cpp
parent89095cc77c719336d4e0774b03447f75bf834c87 (diff)
platformdrmgeneric: get the gralloc usage directly from the handle
There's no point in using a gralloc perform() op to retrieve the usage as it is already stored in the handle like width, height, format, etc. So just copy it to the hwc_drm_bo_t and get it directly. Signed-off-by: Rob Herring <robh@kernel.org> Reviewed-by: Robert Foss <robert.foss@collabora.com> Tested-by: Robert Foss <robert.foss@collabora.com>
Diffstat (limited to 'hwcutils.cpp')
-rw-r--r--hwcutils.cpp8
1 files changed, 2 insertions, 6 deletions
diff --git a/hwcutils.cpp b/hwcutils.cpp
index 0091575..53a7d82 100644
--- a/hwcutils.cpp
+++ b/hwcutils.cpp
@@ -159,12 +159,8 @@ int DrmHwcLayer::ImportBuffer(Importer *importer,
if (ret)
return ret;
- ret = gralloc->perform(gralloc, GRALLOC_MODULE_PERFORM_GET_USAGE,
- handle.get(), &gralloc_buffer_usage);
- if (ret) {
- ALOGE("Failed to get usage for buffer %p (%d)", handle.get(), ret);
- return ret;
- }
+ gralloc_buffer_usage = buffer.operator->()->usage;
+
return 0;
}