OSDN Git Service

Merge remote-tracking branch 'x86/kitkat-x86' into lollipop-x86
[android-x86/external-drm_gralloc.git] / gralloc_drm.h
index dcc6a66..e53ecd9 100644 (file)
@@ -31,6 +31,9 @@
 extern "C" {
 #endif
 
+#define MAX(a, b) (((a) > (b)) ? (a) : (b))
+#define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1))
+
 struct gralloc_drm_t;
 struct gralloc_drm_bo_t;
 
@@ -64,8 +67,6 @@ static inline int gralloc_drm_get_bpp(int format)
                bpp = 3;
                break;
        case HAL_PIXEL_FORMAT_RGB_565:
-       case HAL_PIXEL_FORMAT_RGBA_5551:
-       case HAL_PIXEL_FORMAT_RGBA_4444:
        case HAL_PIXEL_FORMAT_YCbCr_422_I:
                bpp = 2;
                break;
@@ -109,8 +110,8 @@ static inline void gralloc_drm_align_geometry(int format, int *width, int *heigh
                break;
        }
 
-       *width = (*width + align_w - 1) & ~(align_w - 1);
-       *height = (*height + align_h - 1) & ~(align_h - 1);
+       *width = ALIGN(*width, align_w);
+       *height = ALIGN(*height, align_h);
 
        if (extra_height_div)
                *height += *height / extra_height_div;
@@ -136,10 +137,13 @@ int gralloc_drm_bo_add_fb(struct gralloc_drm_bo_t *bo);
 void gralloc_drm_bo_rm_fb(struct gralloc_drm_bo_t *bo);
 int gralloc_drm_bo_post(struct gralloc_drm_bo_t *bo);
 
-int gralloc_drm_reserve_plane(struct gralloc_drm_t *drm, buffer_handle_t handle,
+int gralloc_drm_reserve_plane(struct gralloc_drm_t *drm,
+       buffer_handle_t handle, uint32_t id,
        uint32_t dst_x, uint32_t dst_y, uint32_t dst_w, uint32_t dst_h,
        uint32_t src_x, uint32_t src_y, uint32_t src_w, uint32_t src_h);
 void gralloc_drm_disable_planes(struct gralloc_drm_t *mod);
+int gralloc_drm_set_plane_handle(struct gralloc_drm_t *drm,
+       uint32_t id, buffer_handle_t handle);
 
 #ifdef __cplusplus
 }