sf: Allow HWC composition of virtual displays for HDMI primary
Allow HWC composition of virtual displays for HDMI primary only when the output pixel format of the HDMI display is RGB. CRs-Fixed: 1007249 Change-Id: I9680b162d844e9e6397f919e8dcc1b1a948d182c
This commit is contained in:
parent
537364c722
commit
f5486d6f47
@ -1,4 +1,4 @@
|
|||||||
/* Copyright (c) 2015, The Linux Foundation. All rights reserved.
|
/* Copyright (c) 2015 - 2016, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are
|
* modification, are permitted provided that the following conditions are
|
||||||
@ -45,6 +45,8 @@
|
|||||||
#include <ExSurfaceFlinger/ExHWComposer.h>
|
#include <ExSurfaceFlinger/ExHWComposer.h>
|
||||||
#include <ExSurfaceFlinger/ExVirtualDisplaySurface.h>
|
#include <ExSurfaceFlinger/ExVirtualDisplaySurface.h>
|
||||||
#include <gralloc_priv.h>
|
#include <gralloc_priv.h>
|
||||||
|
#include <qd_utils.h>
|
||||||
|
#include <display_config.h>
|
||||||
#endif
|
#endif
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#include <cutils/properties.h>
|
#include <cutils/properties.h>
|
||||||
@ -176,8 +178,21 @@ bool DisplayUtils::canAllocateHwcDisplayIdForVDS(int usage) {
|
|||||||
|
|
||||||
#ifdef QTI_BSP
|
#ifdef QTI_BSP
|
||||||
#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
|
#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
|
||||||
// Reserve hardware acceleration for WFD use-case
|
int hdmi_node = qdutils::getHDMINode();
|
||||||
flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
|
if(hdmi_node == HWC_DISPLAY_PRIMARY) {
|
||||||
|
int active_config = qdutils::getActiveConfig(HWC_DISPLAY_PRIMARY);
|
||||||
|
if(active_config >= 0) {
|
||||||
|
qdutils::DisplayAttributes attr = qdutils::getDisplayAttributes(active_config,
|
||||||
|
HWC_DISPLAY_PRIMARY);
|
||||||
|
if(!attr.is_yuv) {
|
||||||
|
// Reserve hardware acceleration for WFD use-case
|
||||||
|
flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Reserve hardware acceleration for WFD use-case
|
||||||
|
flag_mask = GRALLOC_USAGE_PRIVATE_WFD;
|
||||||
|
}
|
||||||
#else
|
#else
|
||||||
// Don't allocate HWC display unless we force HWC copy, otherwise
|
// Don't allocate HWC display unless we force HWC copy, otherwise
|
||||||
// incompatible buffers are sent to the media stack
|
// incompatible buffers are sent to the media stack
|
||||||
|
Loading…
Reference in New Issue
Block a user