summaryrefslogtreecommitdiff
authorTellen Yu <tellen.yu@amlogic.com>2017-04-06 03:14:05 (GMT)
committer Gerrit Code Review <gituser@git.myamlogic.com>2017-04-06 03:14:05 (GMT)
commit1eb1ef91a2f2c63620c6bca10cb574b7df976bc3 (patch)
tree69f76e2fab29a0344de53382e2323e2df0eaa168
parentf1f62c91d064f73385626dcc7b8db4831cc441ad (diff)
parentce9aa9c4fddbb66891ff0b9f6fae91da0efd7287 (diff)
downloadgralloc-1eb1ef91a2f2c63620c6bca10cb574b7df976bc3.zip
gralloc-1eb1ef91a2f2c63620c6bca10cb574b7df976bc3.tar.gz
gralloc-1eb1ef91a2f2c63620c6bca10cb574b7df976bc3.tar.bz2
Merge "PD#140524: optimization direct composer" into l-amlogic
Diffstat
-rw-r--r--framebuffer.cpp74
-rw-r--r--framebuffer.h36
2 files changed, 65 insertions, 45 deletions
diff --git a/framebuffer.cpp b/framebuffer.cpp
index e3bb284..4562936 100644
--- a/framebuffer.cpp
+++ b/framebuffer.cpp
@@ -532,58 +532,58 @@ int fb_post_with_fence_locked(
int hwc_fb_post_with_fence_locked(
struct framebuffer_info_t* fbinfo,
- buffer_handle_t hnd,
- int in_fence)
+ struct hwc_fb_sync_request_t* sync_req,
+ buffer_handle_t hnd)
{
#define FBIOPUT_OSD_SYNC_RENDER_ADD 0x4519
- typedef struct {
- unsigned int xoffset;
- unsigned int yoffset;
- int in_fen_fd;
- int out_fen_fd;
- int width;
- int height;
- int format;
- int shared_fd;
- unsigned int op;
- unsigned int reserve;
- } fb_sync_request_t;
-
private_handle_t const* buffer = reinterpret_cast<private_handle_t const*>(hnd);
- fb_sync_request_t sync_req;
- memset(&sync_req, 0, sizeof(fb_sync_request_t));
- sync_req.shared_fd = -1;
- switch (fbinfo->renderMode) {
+ sync_req->shared_fd = -1;
+ switch (sync_req->type) {
case GLES_COMPOSE_MODE:
- sync_req.xoffset = fbinfo->info.xoffset;
- sync_req.yoffset = buffer->offset / fbinfo->finfo.line_length;
+ sync_req->xoffset = fbinfo->info.xoffset;
+ sync_req->yoffset = buffer->offset / fbinfo->finfo.line_length;
+ ALOGD( "GLES, req offset: %d",
+ sync_req->yoffset);
break;
case DIRECT_COMPOSE_MODE:
- sync_req.width = buffer->width;
- sync_req.height = buffer->height;
- sync_req.format = buffer->format;
- sync_req.shared_fd = buffer->share_fd;
+ sync_req->format = buffer->format;
+ sync_req->shared_fd = buffer->share_fd;
+ sync_req->byte_stride = buffer->byte_stride;
+ sync_req->stride = buffer->stride;
+ ALOGD( "Direct, src: (%d, %d, %d, %d), dst: (%d, %d, %d, %d)",
+ sync_req->xoffset,
+ sync_req->yoffset,
+ sync_req->width,
+ sync_req->height,
+ sync_req->dst_x,
+ sync_req->dst_y,
+ sync_req->dst_w,
+ sync_req->dst_h);
break;
case GE2D_COMPOSE_MODE:
- sync_req.width = fbinfo->info.xres;
- sync_req.height = fbinfo->info.yres;
- sync_req.format = HAL_PIXEL_FORMAT_RGBA_8888;
- sync_req.yoffset = fbinfo->yOffset;
- sync_req.shared_fd = buffer->share_fd;
+ sync_req->width = fbinfo->info.xres;
+ sync_req->height = fbinfo->info.yres;
+ sync_req->format = HAL_PIXEL_FORMAT_RGBA_8888;
+ sync_req->yoffset = fbinfo->yOffset;
+ sync_req->shared_fd = buffer->share_fd;
+ ALOGD( "GE2D, width: %d, height: %d",
+ sync_req->width,
+ sync_req->height);
break;
default:
ALOGE("unknown compose mode!!!");
break;
}
- // acquire fence.
- sync_req.in_fen_fd = in_fence;
- sync_req.op = fbinfo->op;
- // ALOGD( "mode: %d, req offset: %d, width: %d, height: %d, format: %d, shared_fd: %d, op: 0x%x\n",
- // fbinfo->renderMode, sync_req.yoffset, sync_req.width, sync_req.height, sync_req.format, sync_req.shared_fd, sync_req.op);
- ioctl(fbinfo->fd, FBIOPUT_OSD_SYNC_RENDER_ADD, &sync_req);
+ ALOGD( "format: %d, shared_fd: %d, op: 0x%x, byte_stride: %d, pixel_stride: %d",
+ sync_req->format,
+ sync_req->shared_fd,
+ sync_req->op,
+ sync_req->byte_stride,
+ sync_req->stride);
+ ioctl(fbinfo->fd, FBIOPUT_OSD_SYNC_RENDER_ADD, sync_req);
- return sync_req.out_fen_fd;
+ return sync_req->out_fen_fd;
}
int fb_post_locked(struct framebuffer_info_t* fbinfo, buffer_handle_t hnd)
diff --git a/framebuffer.h b/framebuffer.h
index c25af9b..4155351 100644
--- a/framebuffer.h
+++ b/framebuffer.h
@@ -34,16 +34,30 @@ typedef struct framebuffer_info_t{
float fps;
int flipFlags;
- // Composer mode.
- int renderMode;
-
// GE2D composer mode used only.
int yOffset;
-
- // osd blank option.
- unsigned int op;
}framebuffer_info_t;
+typedef struct hwc_fb_sync_request_t{
+ unsigned int xoffset;
+ unsigned int yoffset;
+ int in_fen_fd;
+ int out_fen_fd;
+ int width;
+ int height;
+ int format;
+ int shared_fd;
+ unsigned int op;
+ unsigned int type; /*direct render or ge2d*/
+ unsigned int dst_x;
+ unsigned int dst_y;
+ unsigned int dst_w;
+ unsigned int dst_h;
+ int byte_stride;
+ int stride;
+ unsigned int reserve;
+} hwc_fb_sync_request_t;
+
#define ION_IOC_MESON_PHYS_ADDR 8
struct meson_phys_data{
@@ -61,8 +75,14 @@ int update_cursor_buffer_locked(struct framebuffer_info_t* cbinfo, int xres, int
#endif
int fb_post_locked(struct framebuffer_info_t* fbinfo,buffer_handle_t buffer);
-int fb_post_with_fence_locked(struct framebuffer_info_t* fbinfo,buffer_handle_t hnd,int in_fence);
-int hwc_fb_post_with_fence_locked(struct framebuffer_info_t* fbinfo,buffer_handle_t hnd,int in_fence);
+int fb_post_with_fence_locked(
+ struct framebuffer_info_t* fbinfo,
+ buffer_handle_t hnd,
+ int in_fence);
+int hwc_fb_post_with_fence_locked(
+ struct framebuffer_info_t* fbinfo,
+ struct hwc_fb_sync_request_t* sync_req,
+ buffer_handle_t hnd);
int getOsdIdx(int display_type);
int bits_per_pixel();