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:
@@ -42,15 +42,8 @@
|
||||
|
||||
/******************************************************************************/
|
||||
|
||||
#if defined(COPYBIT_MSM7K)
|
||||
#define MAX_SCALE_FACTOR (4)
|
||||
#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];
|
||||
} list;
|
||||
|
||||
memset(&list, 0, sizeof(list));
|
||||
if (ctx->mAlpha < 255) {
|
||||
switch (src->format) {
|
||||
// we don't support plane alpha with RGBA formats
|
||||
@@ -428,7 +422,7 @@ static int stretch_copybit(
|
||||
|
||||
if(src->format == HAL_PIXEL_FORMAT_YV12) {
|
||||
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,
|
||||
src->format, usage)){
|
||||
if(0 == convertYV12toYCrCb420SP(src,yv12_handle)){
|
||||
@@ -509,6 +503,7 @@ static int blit_copybit(
|
||||
static int finish_copybit(struct copybit_device_t *dev)
|
||||
{
|
||||
// NOP for MDP copybit
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
@@ -524,6 +519,11 @@ static int close_copybit(struct hw_device_t *dev)
|
||||
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 */
|
||||
static int open_copybit(const struct hw_module_t* module, const char* name,
|
||||
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.stretch = stretch_copybit;
|
||||
ctx->device.finish = finish_copybit;
|
||||
ctx->device.flush_get_fence = flush_get_fence;
|
||||
ctx->mAlpha = MDP_ALPHA_NOP;
|
||||
ctx->mFlags = 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 = -status;
|
||||
} else {
|
||||
struct fb_fix_screeninfo finfo;
|
||||
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) {
|
||||
status = 0;
|
||||
*device = &ctx->device.common;
|
||||
} else {
|
||||
close_copybit(&ctx->device.common);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user