hwc: Pull in updates from exynos3 hwc

Change-Id: I61e1556da3e2d1e9a8b9c22163f4f11982bda7dc
tirimbino
Andrew Dodd 12 years ago committed by Espen Fjellvær Olsen
parent 6ab6c16999
commit e6a23d7713
  1. 78
      exynos4/hal/libhwcomposer/SecHWC.cpp

@ -527,40 +527,45 @@ static void get_hwc_ui_lay_skipdraw_decision(struct hwc_context_t* ctx,
static int hwc_prepare(hwc_composer_device_1_t *dev, size_t numDisplays, hwc_display_contents_1_t** displays) static int hwc_prepare(hwc_composer_device_1_t *dev, size_t numDisplays, hwc_display_contents_1_t** displays)
{ {
for (uint32_t i = 0; i < numDisplays; i++) { struct hwc_context_t* ctx = (struct hwc_context_t*)dev;
hwc_display_contents_1_t *list = displays[i]; int overlay_win_cnt = 0;
struct hwc_context_t* ctx = (struct hwc_context_t*)dev; int compositionType = 0;
int overlay_win_cnt = 0; int ret;
int compositionType = 0;
int ret; // Compat
hwc_display_contents_1_t* list = NULL;
if (numDisplays > 0) {
list = displays[0];
}
#if defined(BOARD_USES_HDMI) #if defined(BOARD_USES_HDMI)
android::SecHdmiClient *mHdmiClient = android::SecHdmiClient::getInstance(); android::SecHdmiClient *mHdmiClient = android::SecHdmiClient::getInstance();
int hdmi_cable_status = (int)mHdmiClient->getHdmiCableStatus(); int hdmi_cable_status = (int)mHdmiClient->getHdmiCableStatus();
ctx->hdmi_cable_status = hdmi_cable_status; ctx->hdmi_cable_status = hdmi_cable_status;
#endif #endif
#ifdef SKIP_DUMMY_UI_LAY_DRAWING #ifdef SKIP_DUMMY_UI_LAY_DRAWING
if ((list && (!(list->flags & HWC_GEOMETRY_CHANGED))) && if ((list && (!(list->flags & HWC_GEOMETRY_CHANGED))) &&
(ctx->num_of_hwc_layer > 0)) { (ctx->num_of_hwc_layer > 0)) {
get_hwc_ui_lay_skipdraw_decision(ctx, list); get_hwc_ui_lay_skipdraw_decision(ctx, list);
return 0; return 0;
} }
ctx->fb_lay_skip_initialized = 0; ctx->fb_lay_skip_initialized = 0;
ctx->num_of_fb_lay_skip = 0; ctx->num_of_fb_lay_skip = 0;
#ifdef GL_WA_OVLY_ALL #ifdef GL_WA_OVLY_ALL
ctx->ui_skip_frame_cnt = 0; ctx->ui_skip_frame_cnt = 0;
#endif #endif
for (int i = 0; i < NUM_OF_DUMMY_WIN; i++) { for (int i = 0; i < NUM_OF_DUMMY_WIN; i++) {
ctx->win_virt[i].layer_prev_buf = 0; ctx->win_virt[i].layer_prev_buf = 0;
ctx->win_virt[i].layer_index = -1; ctx->win_virt[i].layer_index = -1;
ctx->win_virt[i].status = HWC_WIN_FREE; ctx->win_virt[i].status = HWC_WIN_FREE;
} }
#endif #endif
//if geometry is not changed, there is no need to do any work here //if geometry is not changed, there is no need to do any work here
if (!list || (!(list->flags & HWC_GEOMETRY_CHANGED))) if (!list || (!(list->flags & HWC_GEOMETRY_CHANGED)))
return 0; return 0;
//all the windows are free here.... //all the windows are free here....
@ -656,7 +661,7 @@ static int hwc_prepare(hwc_composer_device_1_t *dev, size_t numDisplays, hwc_dis
reset_win_rect_info(&ctx->win[i]); reset_win_rect_info(&ctx->win[i]);
} }
} }
}
return 0; return 0;
} }
@ -675,8 +680,6 @@ static int hwc_set(hwc_composer_device_1_t *dev,
struct sec_rect src_work_rect; struct sec_rect src_work_rect;
struct sec_rect dst_work_rect; struct sec_rect dst_work_rect;
bool need_swap_buffers = ctx->num_of_fb_layer > 0; bool need_swap_buffers = ctx->num_of_fb_layer > 0;
for (uint32_t i = 0; i < numDisplays; i++) {
hwc_display_contents_1_t* list = displays[i];
memset(&src_img, 0, sizeof(src_img)); memset(&src_img, 0, sizeof(src_img));
memset(&dst_img, 0, sizeof(dst_img)); memset(&dst_img, 0, sizeof(dst_img));
@ -688,6 +691,9 @@ static int hwc_set(hwc_composer_device_1_t *dev,
int rotVal = 0; int rotVal = 0;
#endif #endif
// Only support one display
hwc_display_contents_1_t* list = displays[0];
if (!list) { if (!list) {
//turn off the all windows //turn off the all windows
for (int i = 0; i < NUM_OF_WIN; i++) { for (int i = 0; i < NUM_OF_WIN; i++) {
@ -887,7 +893,7 @@ static int hwc_set(hwc_composer_device_1_t *dev,
} }
} }
#endif #endif
}
return 0; return 0;
} }
@ -1036,12 +1042,22 @@ static int hwc_device_close(struct hw_device_t *dev)
} }
return ret; return ret;
} }
static int hwc_blank(struct hwc_composer_device_1 *dev, int dpy, int blank) static int hwc_blank(struct hwc_composer_device_1 *dev, int dpy, int blank)
{ {
// We're using an older method of screen blanking based on struct hwc_context_t* ctx = (struct hwc_context_t*)dev;
// early_suspend in the kernel. No need to do anything here. if (blank) {
return 0; // release our resources, the screen is turning off
// in our case, there is nothing to do.
ctx->num_of_fb_layer_prev = 0;
return 0;
}
else {
// No need to unblank, will unblank on set()
return 0;
}
} }
static int hwc_device_open(const struct hw_module_t* module, const char* name, static int hwc_device_open(const struct hw_module_t* module, const char* name,
struct hw_device_t** device) struct hw_device_t** device)
{ {

Loading…
Cancel
Save