diff options
author | Lajos Molnar <molnar@ti.com> | 2011-08-31 00:56:15 -0500 |
---|---|---|
committer | Erik Gilling <konkers@android.com> | 2011-09-01 17:33:49 -0700 |
commit | 0b62b7ca3c6430caaebb2d3815642b2ff80f527a (patch) | |
tree | cca73c7ee904f87321d2bbdcbe637ff185c86733 /hwc/hwc.c | |
parent | c35f8ef2dc4bf1606f2b27f750057b12e51cb99a (diff) | |
download | hardware_ti_omap4xxx-0b62b7ca3c6430caaebb2d3815642b2ff80f527a.zip hardware_ti_omap4xxx-0b62b7ca3c6430caaebb2d3815642b2ff80f527a.tar.gz hardware_ti_omap4xxx-0b62b7ca3c6430caaebb2d3815642b2ff80f527a.tar.bz2 |
hwc: handle NULL for prepare() and set()
Go through normal SGX Post2 cycle if layer_list is NULL. Set up
framebuffer if prepare is called with NULL list, and call Post2 interface
as usual if set is called with NULL list.
Change-Id: I2d9d52a6ae6f55c8776361d1733f29de53183154
Diffstat (limited to 'hwc/hwc.c')
-rw-r--r-- | hwc/hwc.c | 17 |
1 files changed, 6 insertions, 11 deletions
@@ -540,7 +540,7 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t* { omap4_hwc_device_t *hwc_dev = (omap4_hwc_device_t *)dev; struct dsscomp_setup_dispc_data *dsscomp = &hwc_dev->dsscomp_data; - struct counts num = { .composited_layers = list->numHwLayers }; + struct counts num = { .composited_layers = list ? list->numHwLayers : 0 }; unsigned int i; pthread_mutex_lock(&hwc_dev->lock); @@ -548,7 +548,7 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t* dsscomp->sync_id = sync_id++; /* Figure out how many layers we can support via DSS */ - for (i = 0; i < list->numHwLayers; i++) { + for (i = 0; list && i < list->numHwLayers; i++) { hwc_layer_t *layer = &list->hwLayers[i]; IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle; @@ -582,8 +582,8 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t* hwc_dev->swap_rb = is_BGR(hwc_dev->fb_dev->base.format); } if (debug) { - LOGD("prepare (%d) %d layers - %s (comp=%d, poss=%d/%d scaled, RGB=%d,BGR=%d,NV12=%d) (ext=%x, %dex/%dmx (last %dex,%din)\n", - dsscomp->sync_id, list->numHwLayers, + LOGD("prepare (%d) - %s (comp=%d, poss=%d/%d scaled, RGB=%d,BGR=%d,NV12=%d) (ext=%x, %dex/%dmx (last %dex,%din)\n", + dsscomp->sync_id, hwc_dev->use_sgx ? "SGX+OVL" : "all-OVL", num.composited_layers, num.possible_overlay_layers, num.scaled_layers, @@ -600,7 +600,7 @@ static int omap4_hwc_prepare(struct hwc_composer_device *dev, hwc_layer_list_t* /* set up if DSS layers */ unsigned int mem_used = 0; - for (i = 0; i < list->numHwLayers && dsscomp->num_ovls < num.max_hw_overlays; i++) { + for (i = 0; list && i < list->numHwLayers && dsscomp->num_ovls < num.max_hw_overlays; i++) { hwc_layer_t *layer = &list->hwLayers[i]; IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle; @@ -754,17 +754,12 @@ static int omap4_hwc_set(struct hwc_composer_device *dev, hwc_display_t dpy, int err; unsigned int i; - if (!list) { - LOGE("list is NULL"); - return 0; - } - pthread_mutex_lock(&hwc_dev->lock); char big_log[1024]; int e = sizeof(big_log); char *end = big_log + e; e -= snprintf(end - e, e, "set H{"); - for (i = 0; i < list->numHwLayers; i++) { + for (i = 0; list && i < list->numHwLayers; i++) { if (i) e -= snprintf(end - e, e, " "); hwc_layer_t *layer = &list->hwLayers[i]; |