summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShirish S <shirish.s@amd.com>2017-10-13 09:54:03 +0530
committerchrome-bot <chrome-bot@chromium.org>2017-10-14 03:18:34 -0700
commit8317bc0658be27b66ebf0b745533adf0214fe3a2 (patch)
treec1b765347d1afbacc456793656bb0d8aebd47baa
parente29a640dd6f26d50e29cabac2611bd97841c2101 (diff)
minigbm: amdgpu: make bo's created with SCANOUT flag mmapable
amdgpu kenrel driver can mmap a 'bo' only if it has AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED flag set. This flag was not set in case if the 'bo' is used as a SCANOUT buffer, for several reasons like it might impact performance etc. But due to several requirements realted testing drm functionalitites like atomicity, multi-planes etc., this restriction needs to be removed. Several known tests related to performance have been done after making this change and none have shown glaring performance regressions. However it should be noted that in case we find any performance related regression in an un-tested scenario this patch needs to be reverted. BUG=b:65297611 TEST=On Kahlee, UI comes up. GLMark2 & GLbench autotests show no performance regression atomictest -t multiplanes passes WebGL Aquarium Change-Id: If629b64f3a14f843972b25d393a0a16058b3044e Signed-off-by: Shirish S <shirish.s@amd.com> Reviewed-on: https://chromium-review.googlesource.com/715037 Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
-rw-r--r--amdgpu.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/amdgpu.c b/amdgpu.c
index 9d2f5b5..3437cb7 100644
--- a/amdgpu.c
+++ b/amdgpu.c
@@ -44,8 +44,8 @@ enum {
const static uint32_t render_target_formats[] = { DRM_FORMAT_ARGB8888, DRM_FORMAT_XBGR8888,
DRM_FORMAT_XRGB8888 };
-const static uint32_t texture_source_formats[] = { DRM_FORMAT_GR88, DRM_FORMAT_R8,
- DRM_FORMAT_NV21, DRM_FORMAT_NV12 };
+const static uint32_t texture_source_formats[] = { DRM_FORMAT_GR88, DRM_FORMAT_R8, DRM_FORMAT_NV21,
+ DRM_FORMAT_NV12 };
static int amdgpu_set_metadata(int fd, uint32_t handle, struct amdgpu_bo_metadata *info)
{
@@ -372,7 +372,7 @@ static int amdgpu_bo_create(struct bo *bo, uint32_t width, uint32_t height, uint
bo->strides[0] = addr_out.pixelPitch * DIV_ROUND_UP(addr_out.pixelBits, 8);
}
- if (use_flags & (BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN |
+ if (use_flags & (BO_USE_SCANOUT | BO_USE_CURSOR | BO_USE_LINEAR | BO_USE_SW_READ_OFTEN |
BO_USE_SW_WRITE_OFTEN | BO_USE_SW_WRITE_RARELY | BO_USE_SW_READ_RARELY))
gem_create_flags |= AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED;
else