Skip to content

Instantly share code, notes, and snippets.

@xc-racer99
Created January 18, 2019 01:45
Show Gist options
  • Save xc-racer99/6c5466d820ae69090189adf249b75d99 to your computer and use it in GitHub Desktop.
Save xc-racer99/6c5466d820ae69090189adf249b75d99 to your computer and use it in GitHub Desktop.
libdrm notes for v3.0 Samsung G2D
diff --git a/exynos/exynos_fimg2d.c b/exynos/exynos_fimg2d.c
index ac6fa687..ad25167f 100644
--- a/exynos/exynos_fimg2d.c
+++ b/exynos/exynos_fimg2d.c
@@ -247,8 +247,10 @@ static void g2d_add_cmd(struct g2d_context *ctx, unsigned long cmd,
{
switch (cmd & ~(G2D_BUF_USERPTR)) {
case SRC_BASE_ADDR_REG:
+ // TODO - not in v3.0
case SRC_PLANE2_BASE_ADDR_REG:
case DST_BASE_ADDR_REG:
+ // TODO - not in v3.0
case DST_PLANE2_BASE_ADDR_REG:
case PAT_BASE_ADDR_REG:
case MASK_BASE_ADDR_REG:
@@ -471,6 +473,7 @@ g2d_solid_fill(struct g2d_context *ctx, struct g2d_image *img,
pt.data.y = y + h;
g2d_add_cmd(ctx, DST_RIGHT_BOTTOM_REG, pt.val);
+ // TODO - not in v3.0
g2d_add_cmd(ctx, SF_COLOR_REG, img->color);
bitblt.val = 0;
@@ -697,6 +700,7 @@ g2d_copy_with_scale(struct g2d_context *ctx, struct g2d_image *src,
scale = 0;
else {
scale = 1;
+ // TODO - Adjust for v3.0
scale_x = g2d_get_scaling(src_w, dst_w);
scale_y = g2d_get_scaling(src_h, dst_h);
}
@@ -865,6 +869,7 @@ g2d_blend(struct g2d_context *ctx, struct g2d_image *src,
bitblt.data.alpha_blend_mode = G2D_ALPHA_BLEND_MODE_ENABLE;
blend.val = g2d_get_blend_op(op);
g2d_add_cmd(ctx, BITBLT_COMMAND_REG, bitblt.val);
+ // TODO - not in v3.0
g2d_add_cmd(ctx, BLEND_FUNCTION_REG, blend.val);
pt.data.x = src_x;
@@ -990,6 +995,7 @@ g2d_scale_and_blend(struct g2d_context *ctx, struct g2d_image *src,
bitblt.data.alpha_blend_mode = G2D_ALPHA_BLEND_MODE_ENABLE;
blend.val = g2d_get_blend_op(op);
g2d_add_cmd(ctx, BITBLT_COMMAND_REG, bitblt.val);
+ // TODO - not in v3.0
g2d_add_cmd(ctx, BLEND_FUNCTION_REG, blend.val);
pt.data.x = src_x;
diff --git a/exynos/exynos_fimg2d.h b/exynos/exynos_fimg2d.h
index a4dfbe73..bff54888 100644
--- a/exynos/exynos_fimg2d.h
+++ b/exynos/exynos_fimg2d.h
@@ -38,25 +38,25 @@ enum e_g2d_color_mode {
G2D_COLOR_FMT_XRGB4444,
G2D_COLOR_FMT_ARGB4444,
G2D_COLOR_FMT_PRGB888,
- G2D_COLOR_FMT_YCbCr444,
- G2D_COLOR_FMT_YCbCr422,
- G2D_COLOR_FMT_YCbCr420,
+ G2D_COLOR_FMT_YCbCr444, /* VER4.1 */
+ G2D_COLOR_FMT_YCbCr422, /* VER4.1 */
+ G2D_COLOR_FMT_YCbCr420, /* VER4.1 */
/* alpha 8bit */
- G2D_COLOR_FMT_A8,
+ G2D_COLOR_FMT_A8, /* VER4.1 */
/* Luminance 8bit: gray color */
- G2D_COLOR_FMT_L8,
+ G2D_COLOR_FMT_L8, /* VER4.1 */
/* alpha 1bit */
- G2D_COLOR_FMT_A1,
+ G2D_COLOR_FMT_A1, /* VER4.1 */
/* alpha 4bit */
- G2D_COLOR_FMT_A4,
+ G2D_COLOR_FMT_A4, /* VER4.1 */
G2D_COLOR_FMT_MASK, /* VER4.1 */
/* COLOR ORDER */
- G2D_ORDER_AXRGB = (0 << 4), /* VER4.1 */
- G2D_ORDER_RGBAX = (1 << 4), /* VER4.1 */
- G2D_ORDER_AXBGR = (2 << 4), /* VER4.1 */
- G2D_ORDER_BGRAX = (3 << 4), /* VER4.1 */
- G2D_ORDER_MASK = (3 << 4), /* VER4.1 */
+ G2D_ORDER_AXRGB = (0 << 4),
+ G2D_ORDER_RGBAX = (1 << 4),
+ G2D_ORDER_AXBGR = (2 << 4),
+ G2D_ORDER_BGRAX = (3 << 4),
+ G2D_ORDER_MASK = (3 << 4),
/* Number of YCbCr plane */
G2D_YCbCr_1PLANE = (0 << 8), /* VER4.1 */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment