Skip to content

Commit

Permalink
Merge tag 'android-7.1.2_r2' into cm-14.1
Browse files Browse the repository at this point in the history
Android 7.1.2 Release 2 (N2G47E)

Change-Id: I5965a19b0700cffa45c69afbfa1556614bb1a3b8
  • Loading branch information
invisiblek committed Apr 5, 2017
2 parents d7dc8cd + d62c8a2 commit 85ca03c
Show file tree
Hide file tree
Showing 205 changed files with 1,083 additions and 447 deletions.
4 changes: 2 additions & 2 deletions Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ ifneq ($(TARGET_BOARD_AUTO),true)
ifneq ($(filter msm8996,$(TARGET_BOARD_PLATFORM)),)
include $(call all-named-subdir-makefiles,msm8996)
else
ifneq ($(filter msmcobalt,$(TARGET_BOARD_PLATFORM)),)
include $(call all-named-subdir-makefiles,msmcobalt)
ifneq ($(filter msmmsm8998,$(TARGET_BOARD_PLATFORM)),)
include $(call all-named-subdir-makefiles,msm8998)
endif
endif
endif
Expand Down
4 changes: 2 additions & 2 deletions msm8226/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,6 @@ endif
# available in the build tree.
# If the macro is not present, the headers are picked from hardware/qcom/msmXXXX
# failing which, they are picked from bionic.
common_deps += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr
kernel_includes += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include
common_deps += $(BOARD_KERNEL_HEADER_DEPENDENCIES)
kernel_includes += $(BOARD_KERNEL_HEADER_DIR)
#endif
4 changes: 0 additions & 4 deletions msm8909/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,15 @@ ifeq ($(ARCH_ARM_HAVE_NEON),true)
endif

ifeq ($(call is-board-platform-in-list, $(MSM_VIDC_TARGET_LIST)), true)
ifneq ($(TARGET_SUPPORTS_WEARABLES), true)
common_flags += -DVENUS_COLOR_FORMAT
endif
endif

ifeq ($(call is-board-platform-in-list, msm8974 msm8226 msm8610 apq8084 \
mpq8092 msm_bronze msm8916 msm8994), true)
common_flags += -DMDSS_TARGET
endif
ifeq ($(call is-board-platform-in-list, msm8909), true)
ifneq ($(TARGET_SUPPORTS_WEARABLES), true)
common_flags += -DVENUS_COLOR_FORMAT
endif
common_flags += -DMDSS_TARGET
endif

Expand Down
4 changes: 3 additions & 1 deletion msm8909/libgralloc/gralloc_priv.h
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,9 @@ struct private_handle_t : public native_handle {
numFds = sNumFds;
}
~private_handle_t() {
base_metadata = 0;
magic = 0;
fd_metadata = 0;
}

bool usesPhysicallyContiguousMemory() {
Expand All @@ -261,7 +263,7 @@ struct private_handle_t : public native_handle {
h->numInts != sNumInts() || h->numFds != sNumFds ||
hnd->magic != sMagic)
{
ALOGD("Invalid gralloc handle (at %p): "
ALOGE("Invalid gralloc handle (at %p): "
"ver(%d/%zu) ints(%d/%d) fds(%d/%d)"
"magic(%c%c%c%c/%c%c%c%c)",
h,
Expand Down
3 changes: 3 additions & 0 deletions msm8909/libgralloc/mapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,7 @@ int gralloc_perform(struct gralloc_module_t const* module,
private_handle_t* hnd = va_arg(args, private_handle_t*);
int *stride = va_arg(args, int *);
if (private_handle_t::validate(hnd)) {
va_end(args);
return res;
}
MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
Expand All @@ -382,6 +383,7 @@ int gralloc_perform(struct gralloc_module_t const* module,
int *stride = va_arg(args, int *);
int *height = va_arg(args, int *);
if (private_handle_t::validate(hnd)) {
va_end(args);
return res;
}
MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
Expand Down Expand Up @@ -416,6 +418,7 @@ int gralloc_perform(struct gralloc_module_t const* module,
private_handle_t* hnd = va_arg(args, private_handle_t*);
int *color_space = va_arg(args, int *);
if (private_handle_t::validate(hnd)) {
va_end(args);
return res;
}
MetaData_t *metadata = (MetaData_t *)hnd->base_metadata;
Expand Down
2 changes: 1 addition & 1 deletion msm8996/sdm/libs/core/display_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -757,7 +757,7 @@ DisplayError DisplayBase::SetColorMode(const std::string &color_mode) {

SDEDisplayMode *sde_display_mode = it->second;

DLOGD("Color Mode Name = %s corresponding mode_id = %d", sde_display_mode->name,
DLOGV_IF(kTagQDCM, "Color Mode Name = %s corresponding mode_id = %d", sde_display_mode->name,
sde_display_mode->id);
DisplayError error = kErrorNone;
error = color_mgr_->ColorMgrSetMode(sde_display_mode->id);
Expand Down
2 changes: 1 addition & 1 deletion msm8996/sdm/libs/hwc2/hwc_display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ HWC2::Error HWCColorMode::HandleColorModeTransform(android_color_mode_t mode,
current_color_mode_ = mode;
current_color_transform_ = hint;
CopyColorTransformMatrix(matrix, color_matrix_);
DLOGI("Setting Color Mode = %d Transform Hint = %d Success", mode, hint);
DLOGV_IF(kTagQDCM, "Setting Color Mode = %d Transform Hint = %d Success", mode, hint);

return HWC2::Error::None;
}
Expand Down
2 changes: 1 addition & 1 deletion msmcobalt/Android.mk → msm8998/Android.mk
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sdm-libs := sdm/libs
display-hals := libqservice libqdutils $(sdm-libs)/utils $(sdm-libs)/core
display-hals := include libqservice libqdutils $(sdm-libs)/utils $(sdm-libs)/core

ifneq ($(TARGET_IS_HEADLESS), true)
display-hals += libcopybit liblight libmemtrack hdmi_cec \
Expand Down
File renamed without changes.
5 changes: 5 additions & 0 deletions msmcobalt/common.mk → msm8998/common.mk
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ display_top := $(call my-dir)
common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers
common_flags += -Wconversion -Wall -Werror -std=c++11

ifeq ($(call is-board-platform-in-list, msmcobalt msm8998), true)
common_flags += -DUSE_COLOR_METADATA
endif

use_hwc2 := false
ifeq ($(TARGET_USES_HWC2), true)
use_hwc2 := true
Expand All @@ -17,6 +21,7 @@ ifneq ($(TARGET_IS_HEADLESS), true)
common_includes += $(display_top)/libcopybit
endif

common_includes += $(display_top)/include
common_includes += $(display_top)/sdm/include

common_header_export_path := qcom/display
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 9 additions & 0 deletions msm8998/include/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
LOCAL_PATH:= $(call my-dir)
include $(LOCAL_PATH)/../common.mk
include $(CLEAR_VARS)

LOCAL_COPY_HEADERS_TO := $(common_header_export_path)
LOCAL_COPY_HEADERS := color_metadata.h

include $(BUILD_COPY_HEADERS)

180 changes: 180 additions & 0 deletions msm8998/include/color_metadata.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
/*
* Copyright (c) 2016, 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 met:
* * Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright notice, this list of
* conditions and the following disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of The Linux Foundation nor the names of its contributors may be used to
* endorse or promote products derived from this software without specific prior written
* permission.
*
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef __COLOR_METADATA_H__
#define __COLOR_METADATA_H__

#ifdef __cplusplus
extern "C" {
#else
#include <stdbool.h>
#endif

typedef enum ColorRange {
Range_Limited = 0,
Range_Full = 1,
Range_Max = 0xff,
} ColorRange;

// The following values matches the HEVC spec
typedef enum ColorPrimaries {
// Unused = 0;
ColorPrimaries_BT709_5 = 1, // ITU-R BT.709-5 or equivalent
/* Unspecified = 2, Reserved = 3*/
ColorPrimaries_BT470_6M = 4, // ITU-R BT.470-6 System M or equivalent
ColorPrimaries_BT601_6_625 = 5, // ITU-R BT.601-6 625 or equivalent
ColorPrimaries_BT601_6_525 = 6, // ITU-R BT.601-6 525 or equivalent
ColorPrimaries_SMPTE_240M = 7, // SMPTE_240M
ColorPrimaries_GenericFilm = 8, // Generic Film
ColorPrimaries_BT2020 = 9, // ITU-R BT.2020 or equivalent
ColorPrimaries_SMPTE_ST428 = 10, // SMPTE_240M
ColorPrimaries_AdobeRGB = 11,
ColorPrimaries_DCIP3 = 12,
ColorPrimaries_Max = 0xff,
} ColorPrimaries;

typedef enum GammaTransfer {
// Unused = 0;
Transfer_sRGB = 1, // ITR-BT.709-5
/* Unspecified = 2, Reserved = 3 */
Transfer_Gamma2_2 = 4,
Transfer_Gamma2_8 = 5,
Transfer_SMPTE_170M = 6, // BT.601-6 525 or 625
Transfer_SMPTE_240M = 7, // SMPTE_240M
Transfer_Linear = 8,
Transfer_HLG = 9,
Transfer_XvYCC = 11, // IEC 61966-2-4
Transfer_BT1361 = 12, // Rec.ITU-R BT.1361 extended gamut
Transfer_SMPTE_ST2084 = 16, // 2084
// transfers unlikely to be required by Android
Transfer_ST_428 = 17, // SMPTE ST 428-1
Transfer_Max = 0xff,
} GammaTransfer;

typedef enum MatrixCoEfficients {
MatrixCoEff_Identity = 0,
MatrixCoEff_BT709_5 = 1,
/* Unspecified = 2, Reserved = 3 */
MatrixCoEff_BT601_6_625 = 5,
MatrixCoEff_BT601_6_525 = 6,
MatrixCoEff_SMPTE240M = 7, // used with 601_525_Unadjusted
MatrixCoEff_BT2020 = 9,
MatrixCoEff_BT2020Constant = 10,
MatrixCoEff_BT601_6_Unadjusted = 11, // Used with BT601_625(KR=0.222, KB=0.071)
MatrixCoEff_DCIP3 = 12,
MatrixCoEff_Max = 0xff,
} MatrixCoEfficients;

typedef struct Primaries {
uint32_t rgbPrimaries[3][2]; // unit 1/50000;
uint32_t whitePoint[2]; // unit 1/50000;
} Primaries;

typedef struct MasteringDisplay {
bool colorVolumeSEIEnabled;
Primaries primaries;
uint32_t maxDisplayLuminance; // unit: cd/m^2.
uint32_t minDisplayLuminance; // unit: 1/10000 cd/m^2.
} MasteringDisplay;

typedef struct ContentLightLevel {
bool lightLevelSEIEnabled;
uint32_t maxContentLightLevel; // unit: cd/m^2.
uint32_t minPicAverageLightLevel; // unit: 1/10000 cd/m^2.
} ContentLightLevel;

typedef struct ColorRemappingInfo {
bool criEnabled;
uint32_t crId;
uint32_t crCancelFlag;
uint32_t crPersistenceFlag;
uint32_t crVideoSignalInfoPresentFlag;
uint32_t crRange;
ColorPrimaries crPrimaries;
GammaTransfer crTransferFunction;
MatrixCoEfficients crMatrixCoefficients;
uint32_t crInputBitDepth;
uint32_t crOutputBitDepth;
uint32_t crPreLutNumValMinusOne[3];
uint32_t crPreLutCodedValue[3*33];
uint32_t crPreLutTargetValue[3*33];
uint32_t crMatrixPresentFlag;
uint32_t crLog2MatrixDenom;
int32_t crCoefficients[3*3];
uint32_t crPostLutNumValMinusOne[3];
uint32_t crPostLutCodedValue[3*33];
uint32_t crPostLutTargetValue[3*33];
} ColorRemappingInfo;

typedef struct ColorMetaData {
// Default values based on sRGB, needs to be overridden in gralloc
// based on the format and size.
ColorPrimaries colorPrimaries;
ColorRange range;
GammaTransfer transfer;
MatrixCoEfficients matrixCoefficients;

MasteringDisplay masteringDisplayInfo;
ContentLightLevel contentLightLevel;
ColorRemappingInfo cRI;
} ColorMetaData;

typedef struct Color10Bit {
uint32_t R: 10;
uint32_t G: 10;
uint32_t B: 10;
uint32_t A: 2;
} Color10Bit;

typedef struct Lut3d {
uint16_t dim; // dimension of each side of LUT cube (ex: 13, 17)in lutEntries
uint16_t gridSize; // number of elements in the gridEntries
/* Matrix ordering convension
for (b = 0; b < dim; b++) {
for (g = 0; g < dim; g++) {
for (r = 0; r < dim; r++) {
read/write [mR mG mB] associated w/ 3DLUT[r][g][b] to/from file
}
}
} */
Color10Bit *lutEntries;
bool validLutEntries; // Indicates if entries are valid and can be used.
/*
The grid is a 1D LUT for each of the R,G,B channels that can be
used to apply an independent nonlinear transformation to each
channel before it is used as a coordinate for addressing
the uniform 3D LUT. This effectively creates a non-uniformly
sampled 3D LUT. This is useful for having independent control
of the sampling grid density along each dimension for greater
precision in spite of having a relatively small number of samples.i
*/
Color10Bit *gridEntries;
bool validGridEntries; // Indicates if entries are valid and can be used.
} Lut3d;

#ifdef __cplusplus
}
#endif

#endif // __COLOR_METADATA_H__
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ libmemalloc_la_CC = @CC@
libmemalloc_la_SOURCES = $(cpp_sources)
libmemalloc_la_CFLAGS = $(COMMON_CFLAGS) -DLOG_TAG=\"qdmemalloc\"
libmemalloc_la_CPPFLAGS = $(AM_CPPFLAGS)
libmemalloc_LDADD = -lhardware -lcutils -llog -lutils -ldl
libmemalloc_la_LIBADD = ../libqdutils/libqdutils.la
libmemalloc_la_LIBADD += -lhardware -lcutils -llog -lutils -ldl
libmemalloc_la_LDFLAGS = -shared -avoid-version

header_sources = gralloc_priv.h \
gr.h
Expand All @@ -31,7 +32,8 @@ libgralloc_la_CC = @CC@
libgralloc_la_SOURCES = $(c_sources)
libgralloc_la_CFLAGS = $(COMMON_CFLAGS) -DLOG_TAG=\"qdgralloc\"
libgralloc_la_CPPFLAGS = $(AM_CPPFLAGS)
libgralloc_LDADD = -lhardware -lcutils -llog -lutils
libgralloc_la_LIBADD = ../libqdutils/libqdutils.la
libgralloc_la_LIBADD += ../libqdutils/libqdMetaData.la
libgralloc_la_LIBADD += libmemalloc.la
libgralloc_la_LIBADD += -lhardware -lcutils -llog -lutils -lbinder
libgralloc_la_LIBADD += libmemalloc.la
libgralloc_la_LDFLAGS = -shared -avoid-version
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,24 @@
#define ION_FLAG_ALLOW_NON_CONTIG 0
#endif

#ifndef ION_FLAG_CP_CAMERA_PREVIEW
#define ION_FLAG_CP_CAMERA_PREVIEW 0
#endif

#ifdef MASTER_SIDE_CP
#define CP_HEAP_ID ION_SECURE_HEAP_ID
#define SD_HEAP_ID ION_SECURE_DISPLAY_HEAP_ID
#define ION_CP_FLAGS (ION_SECURE | ION_FLAG_CP_PIXEL)
#define ION_SD_FLAGS (ION_SECURE | ION_FLAG_CP_SEC_DISPLAY)
#define ION_SC_FLAGS (ION_SECURE | ION_FLAG_CP_CAMERA)
#define ION_SC_PREVIEW_FLAGS (ION_SECURE | ION_FLAG_CP_CAMERA_PREVIEW)
#else // SLAVE_SIDE_CP
#define CP_HEAP_ID ION_CP_MM_HEAP_ID
#define SD_HEAP_ID CP_HEAP_ID
#define ION_CP_FLAGS (ION_SECURE | ION_FLAG_ALLOW_NON_CONTIG)
#define ION_SD_FLAGS ION_SECURE
#define ION_SC_FLAGS ION_SECURE
#define ION_SC_PREVIEW_FLAGS ION_SECURE
#endif

using namespace gralloc;
Expand Down Expand Up @@ -473,6 +481,9 @@ int IonController::allocate(alloc_data& data, int usage)
* VM. Please add it to the define once available.
*/
ionFlags |= ION_SD_FLAGS;
} else if (usage & GRALLOC_USAGE_HW_CAMERA_MASK) {
ionHeapId = ION_HEAP(SD_HEAP_ID);
ionFlags |= (usage & GRALLOC_USAGE_HW_COMPOSER) ? ION_SC_PREVIEW_FLAGS : ION_SC_FLAGS;
} else {
ionHeapId = ION_HEAP(CP_HEAP_ID);
ionFlags |= ION_CP_FLAGS;
Expand Down Expand Up @@ -1108,13 +1119,16 @@ int getRgbDataAddress(private_handle_t* hnd, void** rgb_data)
return err;
}

// Ubwc buffers
unsigned int meta_size = 0;
switch (hnd->format) {
case HAL_PIXEL_FORMAT_BGR_565:
meta_size = getRgbUBwcMetaBufferSize(hnd->width, hnd->height, 2);
break;
case HAL_PIXEL_FORMAT_RGBA_8888:
case HAL_PIXEL_FORMAT_RGBX_8888:
case HAL_PIXEL_FORMAT_RGBA_1010102:
case HAL_PIXEL_FORMAT_RGBX_1010102:
meta_size = getRgbUBwcMetaBufferSize(hnd->width, hnd->height, 4);
break;
default:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 85ca03c

Please sign in to comment.