summaryrefslogtreecommitdiff
path: root/libgralloc
diff options
context:
space:
mode:
authorSaurabh Shah <saurshah@codeaurora.org>2016-10-24 17:16:01 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-28 07:23:10 -0800
commitc5b2b70479378a295590179676e6e276256358a0 (patch)
tree8bdfc0bf61ee7f6eade927fb4bc3a7192141c1cc /libgralloc
parent2bace11fc46d0d3f4ad138174f7bfd3ca041b5b7 (diff)
downloaddisplay-c5b2b70479378a295590179676e6e276256358a0.tar.gz
gralloc/qdutils: Remove unused gralloc code, add driver type check
Remove unused code related to macro tiling from galloc and qdutils. Add API to check for driver type and query caps based on driver. Change-Id: I36cfa5529395c69deb886080be1c904ff5c9ad15 CRs-fixed: 1109207
Diffstat (limited to 'libgralloc')
-rw-r--r--libgralloc/alloc_controller.cpp64
-rw-r--r--libgralloc/gpu.cpp6
-rw-r--r--libgralloc/gr.h30
-rw-r--r--libgralloc/mapper.cpp5
4 files changed, 6 insertions, 99 deletions
diff --git a/libgralloc/alloc_controller.cpp b/libgralloc/alloc_controller.cpp
index 583767a7..7190fc04 100644
--- a/libgralloc/alloc_controller.cpp
+++ b/libgralloc/alloc_controller.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2011 - 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011 - 2017, The Linux Foundation. All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
@@ -107,7 +107,6 @@ static bool useUncached(const int& usage) {
//------------- MDPCapabilityInfo-----------------------//
MDPCapabilityInfo :: MDPCapabilityInfo() {
- qdutils::querySDEInfo(HAS_MACRO_TILE, &isMacroTileSupported);
qdutils::querySDEInfo(HAS_UBWC, &isUBwcSupported);
qdutils::querySDEInfo(HAS_WB_UBWC, &isWBUBWCSupported);
}
@@ -117,7 +116,6 @@ AdrenoMemInfo::AdrenoMemInfo()
{
LINK_adreno_compute_aligned_width_and_height = NULL;
LINK_adreno_compute_padding = NULL;
- LINK_adreno_isMacroTilingSupportedByGpu = NULL;
LINK_adreno_compute_compressedfmt_aligned_width_and_height = NULL;
LINK_adreno_isUBWCSupportedByGpu = NULL;
LINK_adreno_get_gpu_pixel_alignment = NULL;
@@ -128,8 +126,6 @@ AdrenoMemInfo::AdrenoMemInfo()
::dlsym(libadreno_utils, "compute_aligned_width_and_height");
*(void **)&LINK_adreno_compute_padding =
::dlsym(libadreno_utils, "compute_surface_padding");
- *(void **)&LINK_adreno_isMacroTilingSupportedByGpu =
- ::dlsym(libadreno_utils, "isMacroTilingSupportedByGpu");
*(void **)&LINK_adreno_compute_compressedfmt_aligned_width_and_height =
::dlsym(libadreno_utils,
"compute_compressedfmt_aligned_width_and_height");
@@ -157,16 +153,6 @@ AdrenoMemInfo::~AdrenoMemInfo()
}
}
-int AdrenoMemInfo::isMacroTilingSupportedByGPU()
-{
- if ((libadreno_utils)) {
- if(LINK_adreno_isMacroTilingSupportedByGpu) {
- return LINK_adreno_isMacroTilingSupportedByGpu();
- }
- }
- return 0;
-}
-
void AdrenoMemInfo::getAlignedWidthAndHeight(const private_handle_t *hnd, int& aligned_w,
int& aligned_h) {
MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
@@ -241,7 +227,7 @@ void AdrenoMemInfo::getAlignedWidthAndHeight(int width, int height, int format,
// Currently surface padding is only computed for RGB* surfaces.
if (isUncompressedRgbFormat(format) == true) {
- int tileEnabled = ubwc_enabled || isMacroTileEnabled(format, usage);
+ int tileEnabled = ubwc_enabled;
getGpuAlignedWidthHeight(width, height, format, tileEnabled, aligned_w, aligned_h);
} else if (ubwc_enabled) {
getYuvUBwcWidthHeight(width, height, format, aligned_w, aligned_h);
@@ -538,38 +524,6 @@ IMemAlloc* IonController::getAllocator(int flags)
return memalloc;
}
-bool isMacroTileEnabled(int format, int usage)
-{
- bool tileEnabled = false;
- // Check whether GPU & MDSS supports MacroTiling feature
- if(AdrenoMemInfo::getInstance().isMacroTilingSupportedByGPU() &&
- MDPCapabilityInfo::getInstance().isMacroTilingSupportedByMDP())
- {
- // check the format
- switch(format)
- {
- case HAL_PIXEL_FORMAT_RGBA_8888:
- case HAL_PIXEL_FORMAT_RGBX_8888:
- case HAL_PIXEL_FORMAT_BGRA_8888:
- case HAL_PIXEL_FORMAT_RGB_565:
- case HAL_PIXEL_FORMAT_BGR_565:
- {
- tileEnabled = true;
- // check the usage flags
- if (usage & (GRALLOC_USAGE_SW_READ_MASK |
- GRALLOC_USAGE_SW_WRITE_MASK)) {
- // Application intends to use CPU for rendering
- tileEnabled = false;
- }
- break;
- }
- default:
- break;
- }
- }
- return tileEnabled;
-}
-
// helper function
unsigned int getSize(int format, int width, int height, int usage,
const int alignedw, const int alignedh) {
@@ -736,20 +690,6 @@ unsigned int getBufferSizeAndDimensions(int width, int height, int format,
return size;
}
-void getBufferAttributes(int width, int height, int format, int usage,
- int& alignedw, int &alignedh, int& tiled, unsigned int& size)
-{
- tiled = isUBwcEnabled(format, usage) || isMacroTileEnabled(format, usage);
-
- AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(width,
- height,
- format,
- usage,
- alignedw,
- alignedh);
- size = getSize(format, width, height, usage, alignedw, alignedh);
-}
-
void getYuvUbwcSPPlaneInfo(uint64_t base, int width, int height,
int color_format, struct android_ycbcr* ycbcr)
{
diff --git a/libgralloc/gpu.cpp b/libgralloc/gpu.cpp
index 59113141..a0339b4c 100644
--- a/libgralloc/gpu.cpp
+++ b/libgralloc/gpu.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2010 The Android Open Source Project
- * Copyright (c) 2011-2014 The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2014,2017 The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -134,10 +134,6 @@ int gpu_context_t::gralloc_alloc_buffer(unsigned int size, int usage,
flags |= private_handle_t::PRIV_FLAGS_SECURE_DISPLAY;
}
- if(isMacroTileEnabled(format, usage)) {
- flags |= private_handle_t::PRIV_FLAGS_TILE_RENDERED;
- }
-
if (isUBwcEnabled(format, usage)) {
flags |= private_handle_t::PRIV_FLAGS_UBWC_ALIGNED;
}
diff --git a/libgralloc/gr.h b/libgralloc/gr.h
index 7d055fc6..ae26df9a 100644
--- a/libgralloc/gr.h
+++ b/libgralloc/gr.h
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2011 - 2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011 - 2017, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -54,15 +54,6 @@ unsigned int getBufferSizeAndDimensions(int width, int height, int format,
unsigned int getBufferSizeAndDimensions(int width, int height, int format,
int& alignedw, int &alignedh);
-
-// Attributes include aligned width, aligned height, tileEnabled and size of the buffer
-void getBufferAttributes(int width, int height, int format, int usage,
- int& alignedw, int &alignedh,
- int& tileEnabled, unsigned int &size);
-
-
-bool isMacroTileEnabled(int format, int usage);
-
int decideBufferHandlingMechanism(int format, const char *compositionUsed,
int hasBlitEngine, int *needConversion,
int *useBufferDirectly);
@@ -148,15 +139,6 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
*/
void getUnalignedWidthAndHeight(const private_handle_t *hnd, int& unaligned_w,
int& unaligned_h);
-
- /*
- * Function to return whether GPU support MacroTile feature
- *
- * @return >0 : supported
- * 0 : not supported
- */
- int isMacroTilingSupportedByGPU();
-
/*
* Function to query whether GPU supports UBWC for given HAL format
* @return > 0 : supported
@@ -190,8 +172,6 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
int *aligned_w,
int *aligned_h);
- int (*LINK_adreno_isMacroTilingSupportedByGpu) (void);
-
void(*LINK_adreno_compute_compressedfmt_aligned_width_and_height)(
int width,
int height,
@@ -211,20 +191,12 @@ class AdrenoMemInfo : public android::Singleton <AdrenoMemInfo>
class MDPCapabilityInfo : public android::Singleton <MDPCapabilityInfo>
{
- int isMacroTileSupported = 0;
int isUBwcSupported = 0;
int isWBUBWCSupported = 0;
public:
MDPCapabilityInfo();
/*
- * Function to return whether MDP support MacroTile feature
- *
- * @return 1 : supported
- * 0 : not supported
- */
- int isMacroTilingSupportedByMDP() { return isMacroTileSupported; }
- /*
* Function to return whether MDP supports UBWC feature
*
* @return 1 : supported
diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp
index 132c768a..acf5e2c8 100644
--- a/libgralloc/mapper.cpp
+++ b/libgralloc/mapper.cpp
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 The Android Open Source Project
- * Copyright (c) 2011-2016, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2011-2017, The Linux Foundation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -397,8 +397,7 @@ int gralloc_perform(struct gralloc_module_t const* module,
int *alignedWidth = va_arg(args, int *);
int *alignedHeight = va_arg(args, int *);
int *tileEnabled = va_arg(args,int *);
- *tileEnabled = isUBwcEnabled(format, usage) ||
- isMacroTileEnabled(format, usage);
+ *tileEnabled = isUBwcEnabled(format, usage);
AdrenoMemInfo::getInstance().getAlignedWidthAndHeight(width,
height, format, usage, *alignedWidth, *alignedHeight);
res = 0;