display: Enable copybit on msm8610
This change is the hwc and copybit changes need to enable composition to go through mdp on msm8610. Change-Id: If0df3a247c5f4f4310966d14fe8fd839bf84b9d5
This commit is contained in:
@@ -35,5 +35,9 @@ else
|
|||||||
LOCAL_SRC_FILES := software_converter.cpp copybit.cpp
|
LOCAL_SRC_FILES := software_converter.cpp copybit.cpp
|
||||||
include $(BUILD_SHARED_LIBRARY)
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
endif
|
endif
|
||||||
|
ifeq ($(call is-board-platform-in-list,msm8610),true)
|
||||||
|
LOCAL_SRC_FILES := software_converter.cpp copybit.cpp
|
||||||
|
include $(BUILD_SHARED_LIBRARY)
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -42,15 +42,8 @@
|
|||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
#if defined(COPYBIT_MSM7K)
|
|
||||||
#define MAX_SCALE_FACTOR (4)
|
#define MAX_SCALE_FACTOR (4)
|
||||||
#define MAX_DIMENSION (4096)
|
#define MAX_DIMENSION (4096)
|
||||||
#elif defined(COPYBIT_QSD8K)
|
|
||||||
#define MAX_SCALE_FACTOR (8)
|
|
||||||
#define MAX_DIMENSION (2048)
|
|
||||||
#else
|
|
||||||
#error "Unsupported MDP version"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/******************************************************************************/
|
/******************************************************************************/
|
||||||
|
|
||||||
@@ -394,6 +387,7 @@ static int stretch_copybit(
|
|||||||
struct mdp_blit_req req[12];
|
struct mdp_blit_req req[12];
|
||||||
} list;
|
} list;
|
||||||
|
|
||||||
|
memset(&list, 0, sizeof(list));
|
||||||
if (ctx->mAlpha < 255) {
|
if (ctx->mAlpha < 255) {
|
||||||
switch (src->format) {
|
switch (src->format) {
|
||||||
// we don't support plane alpha with RGBA formats
|
// we don't support plane alpha with RGBA formats
|
||||||
@@ -428,7 +422,7 @@ static int stretch_copybit(
|
|||||||
|
|
||||||
if(src->format == HAL_PIXEL_FORMAT_YV12) {
|
if(src->format == HAL_PIXEL_FORMAT_YV12) {
|
||||||
int usage =
|
int usage =
|
||||||
GRALLOC_USAGE_PRIVATE_CAMERA_HEAP|GRALLOC_USAGE_PRIVATE_UNCACHED;
|
GRALLOC_USAGE_PRIVATE_IOMMU_HEAP | GRALLOC_USAGE_PRIVATE_UNCACHED;
|
||||||
if (0 == alloc_buffer(&yv12_handle,src->w,src->h,
|
if (0 == alloc_buffer(&yv12_handle,src->w,src->h,
|
||||||
src->format, usage)){
|
src->format, usage)){
|
||||||
if(0 == convertYV12toYCrCb420SP(src,yv12_handle)){
|
if(0 == convertYV12toYCrCb420SP(src,yv12_handle)){
|
||||||
@@ -509,6 +503,7 @@ static int blit_copybit(
|
|||||||
static int finish_copybit(struct copybit_device_t *dev)
|
static int finish_copybit(struct copybit_device_t *dev)
|
||||||
{
|
{
|
||||||
// NOP for MDP copybit
|
// NOP for MDP copybit
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -524,6 +519,11 @@ static int close_copybit(struct hw_device_t *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int flush_get_fence(struct copybit_device_t *dev, int* fd)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
/** Open a new instance of a copybit device using name */
|
/** Open a new instance of a copybit device using name */
|
||||||
static int open_copybit(const struct hw_module_t* module, const char* name,
|
static int open_copybit(const struct hw_module_t* module, const char* name,
|
||||||
struct hw_device_t** device)
|
struct hw_device_t** device)
|
||||||
@@ -542,6 +542,7 @@ static int open_copybit(const struct hw_module_t* module, const char* name,
|
|||||||
ctx->device.blit = blit_copybit;
|
ctx->device.blit = blit_copybit;
|
||||||
ctx->device.stretch = stretch_copybit;
|
ctx->device.stretch = stretch_copybit;
|
||||||
ctx->device.finish = finish_copybit;
|
ctx->device.finish = finish_copybit;
|
||||||
|
ctx->device.flush_get_fence = flush_get_fence;
|
||||||
ctx->mAlpha = MDP_ALPHA_NOP;
|
ctx->mAlpha = MDP_ALPHA_NOP;
|
||||||
ctx->mFlags = 0;
|
ctx->mFlags = 0;
|
||||||
ctx->mFD = open("/dev/graphics/fb0", O_RDWR, 0);
|
ctx->mFD = open("/dev/graphics/fb0", O_RDWR, 0);
|
||||||
@@ -551,25 +552,8 @@ static int open_copybit(const struct hw_module_t* module, const char* name,
|
|||||||
status, strerror(status));
|
status, strerror(status));
|
||||||
status = -status;
|
status = -status;
|
||||||
} else {
|
} else {
|
||||||
struct fb_fix_screeninfo finfo;
|
status = 0;
|
||||||
if (ioctl(ctx->mFD, FBIOGET_FSCREENINFO, &finfo) == 0) {
|
|
||||||
if (strncmp(finfo.id, "msmfb", 5) == 0) {
|
|
||||||
/* Success */
|
|
||||||
status = 0;
|
|
||||||
} else {
|
|
||||||
ALOGE("Error not msm frame buffer");
|
|
||||||
status = -EINVAL;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ALOGE("Error executing ioctl for screen info");
|
|
||||||
status = -errno;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (status == 0) {
|
|
||||||
*device = &ctx->device.common;
|
*device = &ctx->device.common;
|
||||||
} else {
|
|
||||||
close_copybit(&ctx->device.common);
|
|
||||||
}
|
}
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -144,13 +144,10 @@ static int hwc_prepare_primary(hwc_composer_device_1 *dev,
|
|||||||
if(fbZOrder >= 0)
|
if(fbZOrder >= 0)
|
||||||
ctx->mFBUpdate[dpy]->prepare(ctx, list, fbZOrder);
|
ctx->mFBUpdate[dpy]->prepare(ctx, list, fbZOrder);
|
||||||
|
|
||||||
/* Temporarily commenting out C2D until we support partial
|
if (ctx->mMDP.version < qdutils::MDP_V4_0) {
|
||||||
copybit composition for mixed mode MDP
|
if((fbZOrder >= 0) && ctx->mCopyBit[dpy])
|
||||||
|
ctx->mCopyBit[dpy]->prepare(ctx, list, dpy);
|
||||||
// Use Copybit, when MDP comp fails
|
}
|
||||||
if((fbZOrder >= 0) && ctx->mCopyBit[dpy])
|
|
||||||
ctx->mCopyBit[dpy]->prepare(ctx, list, dpy);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#define DEBUG_COPYBIT 0
|
#define DEBUG_COPYBIT 0
|
||||||
#include <copybit.h>
|
#include <copybit.h>
|
||||||
#include <utils/Timers.h>
|
#include <utils/Timers.h>
|
||||||
|
#include <mdp_version.h>
|
||||||
#include "hwc_copybit.h"
|
#include "hwc_copybit.h"
|
||||||
#include "comptype.h"
|
#include "comptype.h"
|
||||||
#include "gr.h"
|
#include "gr.h"
|
||||||
@@ -244,11 +245,13 @@ bool CopyBit::draw(hwc_context_t *ctx, hwc_display_contents_1_t *list,
|
|||||||
mRelFd[0] = -1;
|
mRelFd[0] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
//Clear the visible region on the render buffer
|
if (ctx->mMDP.version >= qdutils::MDP_V4_0) {
|
||||||
//XXX: Do this only when needed.
|
//Clear the visible region on the render buffer
|
||||||
hwc_rect_t clearRegion;
|
//XXX: Do this only when needed.
|
||||||
getNonWormholeRegion(list, clearRegion);
|
hwc_rect_t clearRegion;
|
||||||
clear(renderBuffer, clearRegion);
|
getNonWormholeRegion(list, clearRegion);
|
||||||
|
clear(renderBuffer, clearRegion);
|
||||||
|
}
|
||||||
// numAppLayers-1, as we iterate from 0th layer index with HWC_COPYBIT flag
|
// numAppLayers-1, as we iterate from 0th layer index with HWC_COPYBIT flag
|
||||||
for (int i = 0; i <= (ctx->listStats[dpy].numAppLayers-1); i++) {
|
for (int i = 0; i <= (ctx->listStats[dpy].numAppLayers-1); i++) {
|
||||||
hwc_layer_1_t *layer = &list->hwLayers[i];
|
hwc_layer_1_t *layer = &list->hwLayers[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user