summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGowtham Tammana <g-tammana@ti.com>2017-01-09 17:29:10 -0600
committerGowtham Tammana <g-tammana@ti.com>2017-01-20 14:24:54 -0500
commit364871e03a502d416716dd9b05e10c6775273641 (patch)
tree1fda0d81c6deef6ab01a5ffd222ffe447f28838a
parentb62e1a95f8a9ed82b209b55621770b58b94022db (diff)
downloaddra7xx-364871e03a502d416716dd9b05e10c6775273641.tar.gz
hwc: Cleanup obsolete code
Removed the following obsolete code - references to egl display and surface as we are not using them - set_nv12_plane() function Change-Id: Ib337266b009d15edf530891c7356cb28ba7ba806 Signed-off-by: Gowtham Tammana <g-tammana@ti.com>
-rw-r--r--hwcomposer/display.c132
-rw-r--r--hwcomposer/hwc.c40
2 files changed, 4 insertions, 168 deletions
diff --git a/hwcomposer/display.c b/hwcomposer/display.c
index 6768e31..58d6f61 100644
--- a/hwcomposer/display.c
+++ b/hwcomposer/display.c
@@ -1701,135 +1701,3 @@ free_plane:
return err;
}
-
-int set_nv12_planes(omap_hwc_device_t *hwc_dev, uint32_t *bo, uint32_t width, int disp)
-{
- int i, ret, flags = 0;
- bool hwc_ovls_found = false;
- uint32_t fb = 1;
-
- kms_display_t *kdisp = &(hwc_dev->displays[disp]->disp_link);
- display_t *display = hwc_dev->displays[disp];
- hwc_display_contents_1_t *display_contents = display->contents;
-
- composition_t *comp = &display->composition;
- struct drm_mode_set_plane *ovr = &comp->plane_info[0];
- hwc_layer_1_t *layer;
-
- for (i = 0;i < display_contents->numHwLayers; i++) {
- layer = &display_contents->hwLayers[i];
-
- if(layer->compositionType == HWC_OVERLAY) {
- hwc_ovls_found = true;
- break;
- }
- }
-
- IMG_native_handle_t *handle = (IMG_native_handle_t *)layer->handle;
-
- /* handle->iWidth is the width of the buffer from SurfaceFlinger and not the
- * width of the source image frame ovr->src_w
- */
- uint32_t pitch[4] = {ALIGN(handle->iWidth, 32),
- ALIGN(handle->iWidth, 32), 0, 0};
-
- /* N12 format within the layer buffer is depicted as follows
- *
- ----------------------------
- | src_y offset |
- |--------------------------|
- | | |
- | | |
- | | |
- | | Y-pixels |
- | | |
- |src_x | |
- |offset| |
- | | |
- | | |
- | |-------------------|
- | | src_y/2 offset |
- | |-------------------|
- | | |
- | | UV Pixels |
- | | |
- | | |
- | | |
- ----------------------------
- */
- uint32_t offset[4] = {ALIGN(ovr->src_x + (handle->iWidth * ovr->src_y), 32),
- ALIGN(handle->iWidth * (handle->iHeight +
- (ovr->src_y/2)) + ovr->src_x, 32), 0, 0};
-
- /* No Overlays managed by DSS*/
- if (!hwc_ovls_found) {
- ovr->fb_id = 0; /* set fb id to 0 to disable plane */
-
- /* Disable plane */
- ret = drmModeSetPlane(hwc_dev->drm_fd,
- ovr->plane_id, kdisp->crtc_id,
- ovr->fb_id, 0, ovr->crtc_x, ovr->crtc_y,
- ovr->crtc_w , ovr->crtc_h , 0 << 16, 0 << 16,
- ovr->src_w << 16, ovr->src_h << 16);
-
-
- if (ret) {
- ALOGE("drmModeSetPlane error: (%d)", errno);
- return ret;
- }
-
- return 1;
- }
-
- if(layer->acquireFenceFd > 0) {
- ret = sync_wait(layer->acquireFenceFd, 1000);
- if (ret < 0) {
- ALOGE ("%s: sync_wait failed. errno: %d errstr = %s",
- __FUNCTION__, errno, strerror (errno));
- }
- }
-
- ret = drmPrimeFDToHandle (hwc_dev->drm_fd, layer->handle->data[0], &bo[0]);
- if (ret) {
- ALOGE("Failed to get fd for DUMB buffer 1 %s", strerror(errno));
- goto fence_cleanup;
- }
-
- bo[1] = bo[0];
- ret = drmModeAddFB2(hwc_dev->drm_fd, ovr->src_w, ovr->src_h,
- DRM_FORMAT_NV12, bo, pitch, offset, &fb, 0);
- if (ret) {
- ALOGE("cannot create framebuffer (%d) with width %d height %d: \n",errno, ovr->src_w, ovr->src_h);
- goto fence_cleanup;
- }
-
- ovr->fb_id = fb;
-
- ret = drmModeObjectSetProperty(hwc_dev->drm_fd, ovr->plane_id,
- DRM_MODE_OBJECT_PLANE, HWC_DRM_ZORDER_PROPERTY, hwc_dev->fb_z);
- if (ret < 0) {
- ALOGE("set z-order for plane id %d failed %d\n", ovr->plane_id, errno);
- goto fence_cleanup;
- }
-
- ret = drmModeSetPlane(hwc_dev->drm_fd, ovr->plane_id, kdisp->crtc_id,
- ovr->fb_id, 0, ovr->crtc_x, ovr->crtc_y,
- ovr->crtc_w , ovr->crtc_h , 0 << 16, 0 << 16,
- ovr->src_w << 16, ovr->src_h << 16);
-
- if (ret) {
- ALOGE("drmModeSetPlane error: (%d): plane_id %d, crtc_id %d, crtc_x %d, crtc_y %d, \
- crtc_w %d, crtc_h %d, src_x %d, src_y %d, \
- src_w %d, src_h %d\n", errno, ovr->plane_id, kdisp->crtc_id,
- ovr->crtc_x, ovr->crtc_y, ovr->crtc_w, ovr->crtc_h,
- ovr->src_x, ovr->src_y, ovr->src_w, ovr->src_h);
-
- goto fence_cleanup;
- }
-
- return 0;
-fence_cleanup:
- close(layer->releaseFenceFd);
- layer->releaseFenceFd = -1;
- return ret;
-}
diff --git a/hwcomposer/hwc.c b/hwcomposer/hwc.c
index a1be62e..df80fab 100644
--- a/hwcomposer/hwc.c
+++ b/hwcomposer/hwc.c
@@ -338,6 +338,7 @@ static int hwc_set_for_display(omap_hwc_device_t *hwc_dev, int disp, hwc_display
composition_t *comp = &display->composition;
blit_device_t *blitter = hwc_dev->blitter;
int i;
+ int err = 0;
if (disp != HWC_DISPLAY_PRIMARY) {
if (comp->wanted_ovls && (comp->avail_ovls < comp->wanted_ovls) &&
@@ -356,7 +357,6 @@ static int hwc_set_for_display(omap_hwc_device_t *hwc_dev, int disp, hwc_display
if (disp == HWC_DISPLAY_PRIMARY)
{
- int err;
int fence_fd = -1;
if (comp->use_blitter) {
err = blitter->set(blitter, display);
@@ -367,13 +367,6 @@ static int hwc_set_for_display(omap_hwc_device_t *hwc_dev, int disp, hwc_display
}
}
- hwc_display_t dpy = NULL;
- hwc_surface_t sur = NULL;
- if (list != NULL) {
- dpy = list->dpy;
- sur = list->sur;
- }
-
/* Blanking primary display is necessary if the bootloader can't be trusted
* However, this causes issues with early camera use-case. The latest
* bootloader seems to have the same configuration what hwc expects
@@ -387,35 +380,10 @@ static int hwc_set_for_display(omap_hwc_device_t *hwc_dev, int disp, hwc_display
}
#endif
- int err = 0;
-
- /* The list can be NULL which means HWC is temporarily disabled. However, if dpy and sur
- * are NULL it means we're turning the screen off.
- */
- if (dpy && sur) {
- if (comp->use_sgx) {
- buffer_handle_t framebuffer = NULL;
- if (layer_stats->framebuffer) {
- /* Layer with HWC_FRAMEBUFFER_TARGET should be last in the list. The buffer handle
- * is updated by SurfaceFlinger after prepare() call, so FB slot has to be updated
- * in set().
- */
- framebuffer = list->hwLayers[list->numHwLayers - 1].handle;
- }
-
- if (framebuffer) {
- comp->buffers[comp->planes[0].fb_id] = framebuffer;
- } else {
- ALOGE("set[%d]: No buffer is provided for GL composition", disp);
- return -EFAULT;
- }
- }
-
- update_display(hwc_dev, disp, list);
+ update_display(hwc_dev, disp, list);
- if (disp == HWC_DISPLAY_PRIMARY)
- showfps();
- }
+ if (disp == HWC_DISPLAY_PRIMARY)
+ showfps();
/* hwc is exiting, clear any pending acquire fences
*/