Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
Add Support for 32bit RGB format
Browse files Browse the repository at this point in the history
i.e. To add support for HAL_PIXEL_FORMAT_RGBA_1010102

Jira: https://jira01.devtools.intel.com/browse/OAM-58928
Tests: Test Passes for the intended format
Signed-off-by: Poornima <[email protected]>
  • Loading branch information
pyn24 authored and kalyankondapally committed Mar 2, 2018
1 parent 85a1578 commit 9441a03
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cros_gralloc/i915_private_android.cc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ uint32_t i915_private_convert_format(int format)
return DRM_FORMAT_P010;
case HAL_PIXEL_FORMAT_RGBA_FP16:
return DRM_FORMAT_XBGR161616;
case HAL_PIXEL_FORMAT_RGBA_1010102:
return DRM_FORMAT_ABGR2101010;
}

return DRM_FORMAT_NONE;
Expand Down Expand Up @@ -81,6 +83,8 @@ int32_t i915_private_invert_format(int format)
return HAL_PIXEL_FORMAT_YCbCr_422_888;
case DRM_FORMAT_XBGR161616:
return HAL_PIXEL_FORMAT_RGBA_FP16;
case DRM_FORMAT_ABGR2101010:
return HAL_PIXEL_FORMAT_RGBA_1010102;
default:
cros_gralloc_error("Unhandled DRM format %4.4s", drmFormat2Str(format));
}
Expand Down
6 changes: 5 additions & 1 deletion i915_private.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ static const uint32_t private_linear_source_formats[] = { DRM_FORMAT_R16, DRM
DRM_FORMAT_YUV420, DRM_FORMAT_YUV422,
DRM_FORMAT_YUV444, DRM_FORMAT_NV21,
DRM_FORMAT_P010, DRM_FORMAT_RGB888, DRM_FORMAT_BGR888,
DRM_FORMAT_XRGB161616, DRM_FORMAT_XBGR161616 };
DRM_FORMAT_XRGB161616, DRM_FORMAT_XBGR161616,
DRM_FORMAT_ABGR2101010 };

static const uint32_t private_source_formats[] = { DRM_FORMAT_P010, DRM_FORMAT_NV12_Y_TILED_INTEL };

Expand Down Expand Up @@ -154,6 +155,8 @@ uint32_t i915_private_bpp_from_format(uint32_t format, size_t plane)
case DRM_FORMAT_XRGB161616:
case DRM_FORMAT_XBGR161616:
return 64;
case DRM_FORMAT_ABGR2101010:
return 32;
}

fprintf(stderr, "drv: UNKNOWN FORMAT %d\n", format);
Expand All @@ -180,6 +183,7 @@ size_t i915_private_num_planes_from_format(uint32_t format)
case DRM_FORMAT_R16:
case DRM_FORMAT_XRGB161616:
case DRM_FORMAT_XBGR161616:
case DRM_FORMAT_ABGR2101010:
return 1;
case DRM_FORMAT_NV12_Y_TILED_INTEL:
case DRM_FORMAT_NV16:
Expand Down

0 comments on commit 9441a03

Please sign in to comment.