From 09e7e82747e56dc27f9fad872fd3be06293c4eca Mon Sep 17 00:00:00 2001 From: Daniel Hillenbrand Date: Fri, 14 Jun 2013 16:18:47 +0200 Subject: exynos4412: update fimg4x http://git.insignal.co.kr/insignal/origen_quad-jb_mr1.1/android/hardware/samsung_slsi/exynos4/log/?h=origen_quad-jb_mr1.1 Change-Id: Idbcc372285b168fa171e195eed43e20c27182fab --- exynos4/hal/include/FimgApi.h | 158 +++++++++++++++++ exynos4/hal/include/sec_g2d_4x.h | 338 ++++++++++++++++++++++++++++++++++++ exynos4/hal/libfimg4x/Android.mk | 6 +- exynos4/hal/libfimg4x/FimgApi.cpp | 106 ++++------- exynos4/hal/libfimg4x/FimgApi.h | 114 ------------ exynos4/hal/libfimg4x/FimgExynos4.h | 3 +- exynos4/hal/libfimg4x/sec_g2d_4x.h | 326 ---------------------------------- 7 files changed, 530 insertions(+), 521 deletions(-) create mode 100644 exynos4/hal/include/FimgApi.h create mode 100644 exynos4/hal/include/sec_g2d_4x.h delete mode 100644 exynos4/hal/libfimg4x/FimgApi.h delete mode 100644 exynos4/hal/libfimg4x/sec_g2d_4x.h diff --git a/exynos4/hal/include/FimgApi.h b/exynos4/hal/include/FimgApi.h new file mode 100644 index 0000000..05ccfb8 --- /dev/null +++ b/exynos4/hal/include/FimgApi.h @@ -0,0 +1,158 @@ +/* +** +** Copyright 2009 Samsung Electronics Co, Ltd. +** Copyright 2008, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +** +** +*/ + +#ifndef FIMG_API_H +#define FIMG_API_H + +#include +#include "sec_g2d_4x.h" + +#undef REAL_DEBUG +#undef ANDROID_LOG + +#if defined(REAL_DEBUG) +#ifdef ANDROID_LOG +#define PRINT SLOGE +#define PRINTD SLOGD +#else +#define PRINT printf +#define PRINTD printf +#endif +#else +void VOID_FUNC(const char *format, ...); + +#define PRINT VOID_FUNC +#define PRINTD VOID_FUNC +#endif + +struct Fimg { + int srcX; + int srcY; + unsigned int srcW; + unsigned int srcH; + unsigned int srcFWStride; // this is not w, just stride (w * bpp) + unsigned int srcFH; + unsigned int srcBPP; + int srcColorFormat; + unsigned char *srcAddr; + + int dstX; + int dstY; + unsigned int dstW; + unsigned int dstH; + unsigned int dstFWStride; // this is not w, just stride (w * bpp) + unsigned int dstFH; + unsigned int dstBPP; + int dstColorFormat; + unsigned char *dstAddr; + + int clipT; + int clipB; + int clipL; + int clipR; + + int mskX; + int mskY; + unsigned int mskW; + unsigned int mskH; + unsigned int mskFWStride; // this is not w, just stride (w * bpp) + unsigned int mskFH; + unsigned int mskBPP; + int mskColorFormat; + unsigned char *mskAddr; + + unsigned long fillcolor; + int rotate; + unsigned int alpha; + int xfermode; + int isDither; + int isFilter; + int colorFilter; + int matrixType; + float matrixSx; + float matrixSy; +}; + +#ifdef __cplusplus + +struct blit_op_table { + int op; + const char *str; +}; + +extern struct blit_op_table optbl[]; + +class FimgApi +{ + public: +#endif + +#ifdef __cplusplus + private : + bool m_flagCreate; + + protected : + FimgApi(); + FimgApi(const FimgApi& rhs) {} + virtual ~FimgApi(); + + public: + bool Create(void); + bool Destroy(void); + inline bool FlagCreate(void) { return m_flagCreate; } + bool Stretch(struct fimg2d_blit *cmd); + bool Sync(void); + + protected: + virtual bool t_Create(void); + virtual bool t_Destroy(void); + virtual bool t_Stretch(struct fimg2d_blit *cmd); + virtual bool t_Sync(void); + virtual bool t_Lock(void); + virtual bool t_UnLock(void); + +}; +#endif + +#ifdef __cplusplus +extern "C" +#endif +struct FimgApi *createFimgApi(); + +#ifdef __cplusplus +extern "C" +#endif +void destroyFimgApi(FimgApi *ptrFimgApi); + +#ifdef __cplusplus +extern "C" +#endif +int stretchFimgApi(struct fimg2d_blit *cmd); +#ifdef __cplusplus +extern "C" +#endif +int SyncFimgApi(void); + +void printDataBlit(char *title, struct fimg2d_blit *cmd); +void printDataBlitRotate(int rotate); +void printDataBlitImage(char *title, struct fimg2d_image *image); +void printDataBlitRect(char *title, struct fimg2d_rect *rect); +void printDataBlitScale(struct fimg2d_scale *scaling); +#endif //FIMG_API_H diff --git a/exynos4/hal/include/sec_g2d_4x.h b/exynos4/hal/include/sec_g2d_4x.h new file mode 100644 index 0000000..601e367 --- /dev/null +++ b/exynos4/hal/include/sec_g2d_4x.h @@ -0,0 +1,338 @@ +/* + * Copyright 2011, Samsung Electronics Co. LTD + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#ifndef _SEC_G2D_DRIVER_H_ +#define _SEC_G2D_DRIVER_H_ + +#define SEC_G2D_DEV_NAME "/dev/fimg2d" +#define G2D_ALPHA_VALUE_MAX (255) + +/* ioctl commands */ +#define FIMG2D_IOCTL_MAGIC 'F' +#define FIMG2D_BITBLT_BLIT _IOWR(FIMG2D_IOCTL_MAGIC, 0, \ + struct fimg2d_blit) +#define FIMG2D_BITBLT_SYNC _IOW(FIMG2D_IOCTL_MAGIC, 1, int) +#define FIMG2D_BITBLT_VERSION _IOR(FIMG2D_IOCTL_MAGIC, 2, \ + struct fimg2d_version) + + +/** + * @BLIT_SYNC: sync mode, to wait for blit done irq + * @BLIT_ASYNC: async mode, not to wait for blit done irq + * + */ +enum blit_sync { + BLIT_SYNC, + BLIT_ASYNC, +}; + +/** + * @ADDR_PHYS: physical address + * @ADDR_USER: user virtual address (physically Non-contiguous) + * @ADDR_USER_RSVD: user virtual address (physically Contiguous) + * @ADDR_DEVICE: specific device virtual address + */ +enum addr_space { + ADDR_NONE, + ADDR_PHYS, + ADDR_KERN, + ADDR_USER, + ADDR_USER_RSVD, + ADDR_DEVICE, +}; + +/** + * Pixel order complies with little-endian style + * + * DO NOT CHANGE THIS ORDER + */ +enum pixel_order { + AX_RGB = 0, + RGB_AX, + AX_BGR, + BGR_AX, + ARGB_ORDER_END, + + P1_CRY1CBY0, + P1_CBY1CRY0, + P1_Y1CRY0CB, + P1_Y1CBY0CR, + P1_ORDER_END, + + P2_CRCB, + P2_CBCR, + P2_ORDER_END, +}; + +/** + * DO NOT CHANGE THIS ORDER + */ +enum color_format { + CF_XRGB_8888 = 0, + CF_ARGB_8888, + CF_RGB_565, + CF_XRGB_1555, + CF_ARGB_1555, + CF_XRGB_4444, + CF_ARGB_4444, + CF_RGB_888, + CF_YCBCR_444, + CF_YCBCR_422, + CF_YCBCR_420, + CF_A8, + CF_L8, + SRC_DST_FORMAT_END, + + CF_MSK_1BIT, + CF_MSK_4BIT, + CF_MSK_8BIT, + CF_MSK_16BIT_565, + CF_MSK_16BIT_1555, + CF_MSK_16BIT_4444, + CF_MSK_32BIT_8888, + MSK_FORMAT_END, +}; + +enum rotation { + ORIGIN, + ROT_90, /* clockwise */ + ROT_180, + ROT_270, + XFLIP, /* x-axis flip */ + YFLIP, /* y-axis flip */ +}; + +/** + * @NO_REPEAT: no effect + * @REPEAT_NORMAL: repeat horizontally and vertically + * @REPEAT_PAD: pad with pad color + * @REPEAT_REFLECT: reflect horizontally and vertically + * @REPEAT_CLAMP: pad with edge color of original image + * + * DO NOT CHANGE THIS ORDER + */ +enum repeat { + NO_REPEAT = 0, + REPEAT_NORMAL, /* default setting */ + REPEAT_PAD, + REPEAT_REFLECT, REPEAT_MIRROR = REPEAT_REFLECT, + REPEAT_CLAMP, +}; + +enum scaling { + NO_SCALING, + SCALING_NEAREST, + SCALING_BILINEAR, +}; + +/** + * @SCALING_PIXELS: ratio in pixels + * @SCALING_RATIO: ratio in fixed point 16 + */ +enum scaling_factor { + SCALING_PIXELS, + SCALING_RATIO, +}; + +/** + * premultiplied alpha + */ +enum premultiplied { + PREMULTIPLIED, + NON_PREMULTIPLIED, +}; + +/** + * @TRANSP: discard bluescreen color + * @BLUSCR: replace bluescreen color with background color + */ +enum bluescreen { + OPAQUE, + TRANSP, + BLUSCR, +}; + +/** + * DO NOT CHANGE THIS ORDER + */ +enum blit_op { + BLIT_OP_SOLID_FILL = 0, + + BLIT_OP_CLR, + BLIT_OP_SRC, BLIT_OP_SRC_COPY = BLIT_OP_SRC, + BLIT_OP_DST, + BLIT_OP_SRC_OVER, + BLIT_OP_DST_OVER, BLIT_OP_OVER_REV = BLIT_OP_DST_OVER, + BLIT_OP_SRC_IN, + BLIT_OP_DST_IN, BLIT_OP_IN_REV = BLIT_OP_DST_IN, + BLIT_OP_SRC_OUT, + BLIT_OP_DST_OUT, BLIT_OP_OUT_REV = BLIT_OP_DST_OUT, + BLIT_OP_SRC_ATOP, + BLIT_OP_DST_ATOP, BLIT_OP_ATOP_REV = BLIT_OP_DST_ATOP, + BLIT_OP_XOR, + + BLIT_OP_ADD, + BLIT_OP_MULTIPLY, + BLIT_OP_SCREEN, + BLIT_OP_DARKEN, + BLIT_OP_LIGHTEN, + + BLIT_OP_DISJ_SRC_OVER, + BLIT_OP_DISJ_DST_OVER, BLIT_OP_SATURATE = BLIT_OP_DISJ_DST_OVER, + BLIT_OP_DISJ_SRC_IN, + BLIT_OP_DISJ_DST_IN, BLIT_OP_DISJ_IN_REV = BLIT_OP_DISJ_DST_IN, + BLIT_OP_DISJ_SRC_OUT, + BLIT_OP_DISJ_DST_OUT, BLIT_OP_DISJ_OUT_REV = BLIT_OP_DISJ_DST_OUT, + BLIT_OP_DISJ_SRC_ATOP, + BLIT_OP_DISJ_DST_ATOP, BLIT_OP_DISJ_ATOP_REV = BLIT_OP_DISJ_DST_ATOP, + BLIT_OP_DISJ_XOR, + + BLIT_OP_CONJ_SRC_OVER, + BLIT_OP_CONJ_DST_OVER, BLIT_OP_CONJ_OVER_REV = BLIT_OP_CONJ_DST_OVER, + BLIT_OP_CONJ_SRC_IN, + BLIT_OP_CONJ_DST_IN, BLIT_OP_CONJ_IN_REV = BLIT_OP_CONJ_DST_IN, + BLIT_OP_CONJ_SRC_OUT, + BLIT_OP_CONJ_DST_OUT, BLIT_OP_CONJ_OUT_REV = BLIT_OP_CONJ_DST_OUT, + BLIT_OP_CONJ_SRC_ATOP, + BLIT_OP_CONJ_DST_ATOP, BLIT_OP_CONJ_ATOP_REV = BLIT_OP_CONJ_DST_ATOP, + BLIT_OP_CONJ_XOR, + + /* user select coefficient manually */ + BLIT_OP_USER_COEFF, + + BLIT_OP_USER_SRC_GA, + + /* Add new operation type here */ + + /* end of blit operation */ + BLIT_OP_END, + + /* driver not supporting format */ + BLIT_OP_NOT_SUPPORTED +}; + +/** + * @start: start address or unique id of image + */ +struct fimg2d_addr { + enum addr_space type; + unsigned long start; +}; + +struct fimg2d_rect { + int x1; + int y1; + int x2; /* x1 + width */ + int y2; /* y1 + height */ +}; + +/** + * pixels can be different from src, dst or clip rect + */ +struct fimg2d_scale { + enum scaling mode; + + /* ratio in pixels */ + int src_w, src_h; + int dst_w, dst_h; +}; + +struct fimg2d_clip { + bool enable; + int x1; + int y1; + int x2; /* x1 + width */ + int y2; /* y1 + height */ +}; + +struct fimg2d_repeat { + enum repeat mode; + unsigned long pad_color; +}; + +/** + * @bg_color: bg_color is valid only if bluescreen mode is BLUSCR. + */ +struct fimg2d_bluscr { + enum bluescreen mode; + unsigned long bs_color; + unsigned long bg_color; +}; + +/** + * @plane2: address info for CbCr in YCbCr 2plane mode + * @rect: crop/clip rect + * @need_cacheopr: true if cache coherency is required + */ +struct fimg2d_image { + int width; + int height; + int stride; + enum pixel_order order; + enum color_format fmt; + struct fimg2d_addr addr; + struct fimg2d_addr plane2; + struct fimg2d_rect rect; + bool need_cacheopr; +}; + +/** + * @solid_color: + * src color instead of src image / dst color instead of dst read image. + * color format and order must be ARGB8888(A is MSB). + * premultiplied format must be same to 'premult' of this struct. + * @g_alpha: global(constant) alpha. 0xff is opaque, 0 is transparnet + * @dither: dithering + * @rotate: rotation degree in clockwise + * @premult: alpha premultiplied mode for read & write + * @scaling: common scaling info for src and mask image. + * @repeat: repeat type (tile mode) + * @bluscr: blue screen and transparent mode + */ +struct fimg2d_param { + unsigned long solid_color; + unsigned char g_alpha; + bool dither; + enum rotation rotate; + enum premultiplied premult; + struct fimg2d_scale scaling; + struct fimg2d_repeat repeat; + struct fimg2d_bluscr bluscr; + struct fimg2d_clip clipping; +}; + +/** + * @op: blit operation mode + * @src: set when using src image + * @msk: set when using mask image + * @tmp: set when using 2-step blit at a single command + * @dst: dst must not be null + * * tmp image must be the same to dst except memory address + * @seq_no: user debugging info. + * for example, user can set sequence number or pid. + */ +struct fimg2d_blit { + enum blit_op op; + struct fimg2d_param param; + struct fimg2d_image *src; + struct fimg2d_image *msk; + struct fimg2d_image *tmp; + struct fimg2d_image *dst; + enum blit_sync sync; + unsigned int seq_no; +}; + +#endif /*_SEC_G2D_DRIVER_H_*/ diff --git a/exynos4/hal/libfimg4x/Android.mk b/exynos4/hal/libfimg4x/Android.mk index f42da3f..a43d635 100644 --- a/exynos4/hal/libfimg4x/Android.mk +++ b/exynos4/hal/libfimg4x/Android.mk @@ -2,15 +2,15 @@ LOCAL_PATH:= $(call my-dir) include $(CLEAR_VARS) ifeq ($(BOARD_USES_FIMGAPI),true) - -#LOCAL_C_INCLUDES += $(LOCAL_PATH)/../../include -LOCAL_C_INCLUDES += external/skia/include/core LOCAL_MODULE_TAGS := optional LOCAL_SRC_FILES:= \ FimgApi.cpp \ FimgExynos4.cpp +LOCAL_C_INCLUDES += \ + $(LOCAL_PATH)/../include + LOCAL_SHARED_LIBRARIES:= liblog libutils libbinder LOCAL_MODULE:= libfimg diff --git a/exynos4/hal/libfimg4x/FimgApi.cpp b/exynos4/hal/libfimg4x/FimgApi.cpp index 444e9c9..8cca61c 100644 --- a/exynos4/hal/libfimg4x/FimgApi.cpp +++ b/exynos4/hal/libfimg4x/FimgApi.cpp @@ -270,107 +270,61 @@ extern "C" int SyncFimgApi(void) void printDataBlit(char *title, struct fimg2d_blit *cmd) { - ALOGI("%s\n", title); + SLOGI("%s\n", title); - ALOGI(" sequence_no. = %u\n", cmd->seq_no); - ALOGI(" blit_op = %d(%s)\n", cmd->op, optbl[cmd->op].str); - ALOGI(" fill_color = %X\n", cmd->solid_color); - ALOGI(" global_alpha = %u\n", (unsigned int)cmd->g_alpha); - ALOGI(" PREMULT = %s\n", cmd->premult == PREMULTIPLIED ? "PREMULTIPLIED" : "NON-PREMULTIPLIED"); - ALOGI(" do_dither = %s\n", cmd->dither == true ? "dither" : "no-dither"); + SLOGI(" sequence_no. = %u\n", cmd->seq_no); + SLOGI(" blit_op = %d(%s)\n", cmd->op, optbl[cmd->op].str); + SLOGI(" fill_color = %X\n", cmd->param.solid_color); + SLOGI(" global_alpha = %u\n", (unsigned int)cmd->param.g_alpha); + SLOGI(" PREMULT = %s\n", cmd->param.premult == PREMULTIPLIED ? "PREMULTIPLIED" : "NON-PREMULTIPLIED"); + SLOGI(" do_dither = %s\n", cmd->param.dither == true ? "dither" : "no-dither"); - printDataBlitRotate(cmd->rotate); + printDataBlitRotate(cmd->param.rotate); - printDataBlitScale(cmd->scaling); + printDataBlitScale(&cmd->param.scaling); printDataBlitImage("SRC", cmd->src); printDataBlitImage("DST", cmd->dst); printDataBlitImage("MSK", cmd->msk); - printDataBlitRect("SRC", cmd->src_rect); - printDataBlitRect("DST", cmd->dst_rect); - printDataBlitRect("MSK", cmd->msk_rect); - - printDataBlitClip(cmd->clipping); + printDataBlitRect("SRC", &cmd->src->rect); + printDataBlitRect("DST", &cmd->dst->rect); + printDataBlitRect("MSK", &cmd->msk->rect); } void printDataBlitImage(char *title, struct fimg2d_image *image) { if (NULL != image) { - ALOGI(" Image_%s\n", title); - ALOGI(" addr = %X\n", image->addr.start); - ALOGI(" size = %u\n", image->addr.size); - ALOGI(" (width, height) = (%d, %d)\n", image->width, image->height); - ALOGI(" format = %d\n", image->fmt); + SLOGI(" Image_%s\n", title); + SLOGI(" addr = %X\n", image->addr.start); + SLOGI(" format = %d\n", image->fmt); } else - ALOGI(" Image_%s : NULL\n", title); + SLOGI(" Image_%s : NULL\n", title); } void printDataBlitRect(char *title, struct fimg2d_rect *rect) { if (NULL != rect) { - ALOGI(" RECT_%s\n", title); - ALOGI(" (x1, y1) = (%d, %d)\n", rect->x1, rect->y1); - ALOGI(" (x2, y2) = (%d, %d)\n", rect->x2, rect->y2); - ALOGI(" (width, height) = (%d, %d)\n", rect->x2 - rect->x1, rect->y2 - rect->y1); + SLOGI(" RECT_%s\n", title); + SLOGI(" (x1, y1) = (%d, %d)\n", rect->x1, rect->y1); + SLOGI(" (x2, y2) = (%d, %d)\n", rect->x2, rect->y2); + SLOGI(" (width, height) = (%d, %d)\n", rect->x2 - rect->x1, rect->y2 - rect->y1); } else - ALOGI(" RECT_%s : NULL\n", title); -} - -void printDataBlitRotate(enum rotation rotate) -{ - ALOGI(" ROTATE : %d\n", rotate); + SLOGI(" RECT_%s : NULL\n", title); } -void printDataBlitClip(struct fimg2d_clip *clip) +void printDataBlitRotate(int rotate) { - if (NULL != clip) { - ALOGI(" CLIP\n"); - ALOGI(" clip %s\n", clip->enable == true ? "enabled" : "disabled"); - ALOGI(" (x1, y1) = (%d, %d)\n", clip->x1, clip->y1); - ALOGI(" (x2, y2) = (%d, %d)\n", clip->x2, clip->y2); - ALOGI(" (width, hight) = (%d, %d)\n", clip->x2 - clip->x1, clip->y2 - clip->y1); - } else - ALOGI(" CLIP : NULL\n"); + SLOGI(" ROTATE : %d\n", rotate); } void printDataBlitScale(struct fimg2d_scale *scaling) { - if (NULL != scaling) { - ALOGI(" SCALING\n"); - ALOGI(" scale_mode : %s\n", scaling->mode == 0 ? - "NO_SCALING" : - (scaling->mode == 1 ? "SCALING_NEAREST" : "SCALING_BILINEAR")); - ALOGI(" scaling_factor_unit : %s\n", scaling->factor == 0 ? "PERCENT" : "PIXEL"); - - if (scaling->factor == 0) - ALOGI(" scaling_factor : (scale_w, scale_y) = (%d, %d)\n", scaling->scale_w, scaling->scale_h); - else { - ALOGI(" src : (src_w, src_h) = (%d, %d)\n", scaling->src_w, scaling->src_h); - ALOGI(" dst : (dst_w, dst_h) = (%d, %d)\n", scaling->dst_w, scaling->dst_h); - ALOGI(" scaling_factor : (scale_w, scale_y) = (%3.2f, %3.2f)\n", (double)scaling->dst_w / scaling->src_w, (double)scaling->dst_h / scaling->src_h); - } - } else - ALOGI(" SCALING : NULL(NO SCALE MODE)\n"); - -} - -void printDataMatrix(int matrixType) -{ - ALOGI(" MATRIX\n"); - - if (matrixType & SkMatrix::kIdentity_Mask) - ALOGI(" Matrix_type : Identity_Mask\n"); - - if (matrixType & SkMatrix::kTranslate_Mask) - ALOGI(" Matrix_type : Translate_Mask(the matrix has translation)\n"); - - if (matrixType & SkMatrix::kScale_Mask) - ALOGI(" Matrix_type : Scale_Mask(the matrix has X or Y scale)\n"); - - if (matrixType & SkMatrix::kAffine_Mask) - ALOGI(" Matrix_type : Affine_Mask(the matrix skews or rotates)\n"); - - if (matrixType & SkMatrix::kPerspective_Mask) - ALOGI(" Matrix_type : Perspective_Mask(the matrix is in perspective)\n"); + SLOGI(" SCALING\n"); + SLOGI(" scale_mode : %s\n", scaling->mode == 0 ? + "NO_SCALING" : + (scaling->mode == 1 ? "SCALING_NEAREST" : "SCALING_BILINEAR")); + SLOGI(" src : (src_w, src_h) = (%d, %d)\n", scaling->src_w, scaling->src_h); + SLOGI(" dst : (dst_w, dst_h) = (%d, %d)\n", scaling->dst_w, scaling->dst_h); + SLOGI(" scaling_factor : (scale_w, scale_y) = (%3.2f, %3.2f)\n", (double)scaling->dst_w / scaling->src_w, (double)scaling->dst_h / scaling->src_h); } diff --git a/exynos4/hal/libfimg4x/FimgApi.h b/exynos4/hal/libfimg4x/FimgApi.h deleted file mode 100644 index 925345e..0000000 --- a/exynos4/hal/libfimg4x/FimgApi.h +++ /dev/null @@ -1,114 +0,0 @@ -/* -** -** Copyright 2009 Samsung Electronics Co, Ltd. -** Copyright 2008, The Android Open Source Project -** -** Licensed under the Apache License, Version 2.0 (the "License"); -** you may not use this file except in compliance with the License. -** You may obtain a copy of the License at -** -** http://www.apache.org/licenses/LICENSE-2.0 -** -** Unless required by applicable law or agreed to in writing, software -** distributed under the License is distributed on an "AS IS" BASIS, -** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -** See the License for the specific language governing permissions and -** limitations under the License. -** -** -*/ - -#ifndef FIMG_API_H -#define FIMG_API_H - -#include -#include "SkMatrix.h" -#include "sec_g2d_4x.h" - -#define REAL_DEBUG -#define ANDROID_ALOG - -#if defined(REAL_DEBUG) -#ifdef ANDROID_ALOG -#define PRINT ALOGE -#define PRINTD ALOGD -#else -#define PRINT printf -#define PRINTD printf -#endif -#else -void VOID_FUNC(const char *format, ...); - -#define PRINT VOID_FUNC -#define PRINTD VOID_FUNC -#endif - -#ifdef __cplusplus - -struct blit_op_table { - int op; - const char *str; -}; - -extern struct blit_op_table optbl[]; - -class FimgApi -{ -public: -#endif - -#ifdef __cplusplus -private : - bool m_flagCreate; - -protected : - FimgApi(); - FimgApi(const FimgApi& rhs) {} - virtual ~FimgApi(); - -public: - bool Create(void); - bool Destroy(void); - inline bool FlagCreate(void) { return m_flagCreate; } - bool Stretch(struct fimg2d_blit *cmd); - bool Sync(void); - -protected: - virtual bool t_Create(void); - virtual bool t_Destroy(void); - virtual bool t_Stretch(struct fimg2d_blit *cmd); - virtual bool t_Sync(void); - virtual bool t_Lock(void); - virtual bool t_UnLock(void); - -}; -#endif - -#ifdef __cplusplus -extern "C" -#endif -struct FimgApi *createFimgApi(); - -#ifdef __cplusplus -extern "C" -#endif -void destroyFimgApi(FimgApi *ptrFimgApi); - -#ifdef __cplusplus -extern "C" -#endif -int stretchFimgApi(struct fimg2d_blit *cmd); -#ifdef __cplusplus -extern "C" -#endif -int SyncFimgApi(void); - -void printDataBlit(char *title, struct fimg2d_blit *cmd); -void printDataBlitRotate(enum rotation rotate); -void printDataBlitImage(char *title, struct fimg2d_image *image); -void printDataBlitRect(char *title, struct fimg2d_rect *rect); -void printDataBlitClip(struct fimg2d_clip *clip); -void printDataBlitScale(struct fimg2d_scale *scaling); -void printDataMatrix(int matrixType); - -#endif //FIMG_API_H diff --git a/exynos4/hal/libfimg4x/FimgExynos4.h b/exynos4/hal/libfimg4x/FimgExynos4.h index 2a7c42f..674fd7a 100644 --- a/exynos4/hal/libfimg4x/FimgExynos4.h +++ b/exynos4/hal/libfimg4x/FimgExynos4.h @@ -35,7 +35,6 @@ #include #include -#include #include #include @@ -46,7 +45,7 @@ namespace android { -#define NUMBER_FIMG_LIST (1) // kcoolsw : because of pmem +#define NUMBER_FIMG_LIST (1) #define GET_RECT_SIZE(rect) ((rect->full_w) * (rect->h) * (rect->bytes_per_pixel)) #define GET_REAL_SIZE(rect) ((rect->full_w) * (rect->h) * (rect->bytes_per_pixel)) #define GET_START_ADDR(rect) (rect->virt_addr + ((rect->y * rect->full_w) * rect->bytes_per_pixel)) diff --git a/exynos4/hal/libfimg4x/sec_g2d_4x.h b/exynos4/hal/libfimg4x/sec_g2d_4x.h deleted file mode 100644 index b9ddbb2..0000000 --- a/exynos4/hal/libfimg4x/sec_g2d_4x.h +++ /dev/null @@ -1,326 +0,0 @@ -/* - * Copyright 2011, Samsung Electronics Co. LTD - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -#ifndef __SEC_G2D_4X_H -#define __SEC_G2D_4X_H __FILE__ - -#define SEC_G2D_DEV_NAME "/dev/fimg2d" - -/* ioctl commands */ -#define FIMG2D_IOCTL_MAGIC 'F' -#define FIMG2D_BITBLT_BLIT _IOWR(FIMG2D_IOCTL_MAGIC, 0, struct fimg2d_blit) -#define FIMG2D_BITBLT_SYNC _IO(FIMG2D_IOCTL_MAGIC, 1) -#define FIMG2D_BITBLT_VERSION _IOR(FIMG2D_IOCTL_MAGIC, 2, struct fimg2d_version) - -#define G2D_ALPHA_VALUE_MAX (255) - -enum addr_space { - ADDR_UNKNOWN, - ADDR_PHYS, - ADDR_KERN, - ADDR_USER, - ADDR_DEVICE, -}; - -/** - * DO NOT CHANGE THIS ORDER - */ -enum pixel_order { - AX_RGB = 0, - RGB_AX, - AX_BGR, - BGR_AX, - ARGB_ORDER_END, - - P1_CRY1CBY0, - P1_CBY1CRY0, - P1_Y1CRY0CB, - P1_Y1CBY0CR, - P1_ORDER_END, - - P2_CRCB, - P2_CBCR, - P2_ORDER_END, -}; - -/** - * DO NOT CHANGE THIS ORDER - */ -enum color_format { - CF_XRGB_8888 = 0, - CF_ARGB_8888, - CF_RGB_565, - CF_XRGB_1555, - CF_ARGB_1555, - CF_XRGB_4444, - CF_ARGB_4444, - CF_RGB_888, - CF_YCBCR_444, - CF_YCBCR_422, - CF_YCBCR_420, - CF_A8, - CF_L8, - SRC_DST_FORMAT_END, - - CF_MSK_1BIT, - CF_MSK_4BIT, - CF_MSK_8BIT, - CF_MSK_16BIT_565, - CF_MSK_16BIT_1555, - CF_MSK_16BIT_4444, - CF_MSK_32BIT_8888, - MSK_FORMAT_END, -}; - -enum rotation { - ORIGIN, - ROT_90, /* clockwise */ - ROT_180, - ROT_270, - XFLIP, /* x-axis flip */ - YFLIP, /* y-axis flip */ -}; - -/** - * @NO_REPEAT: no effect - * @REPEAT_NORMAL: repeat horizontally and vertically - * @REPEAT_PAD: pad with pad color - * @REPEAT_REFLECT: reflect horizontally and vertically - * @REPEAT_CLAMP: pad with edge color of original image - * - * DO NOT CHANGE THIS ORDER - */ -enum repeat { - NO_REPEAT = 0, - REPEAT_NORMAL, /* default setting */ - REPEAT_PAD, - REPEAT_REFLECT, REPEAT_MIRROR = REPEAT_REFLECT, - REPEAT_CLAMP, -}; - -enum scaling { - NO_SCALING, - SCALING_NEAREST, - SCALING_BILINEAR, -}; - -/** - * @SCALING_PERCENTAGE: percentage of width, height - * @SCALING_PIXELS: coordinate of src, dest - */ -enum scaling_factor { - SCALING_PERCENTAGE, - SCALING_PIXELS, -}; - -/** - * premultiplied alpha - */ -enum premultiplied { - PREMULTIPLIED, - NON_PREMULTIPLIED, -}; - -/** - * @TRANSP: discard bluescreen color - * @BLUSCR: replace bluescreen color with background color - */ -enum bluescreen { - OPAQUE, - TRANSP, - BLUSCR, -}; - -/** - * DO NOT CHANGE THIS ORDER - */ -enum blit_op { - BLIT_OP_SOLID_FILL = 0, - - BLIT_OP_CLR, - BLIT_OP_SRC, BLIT_OP_SRC_COPY = BLIT_OP_SRC, - BLIT_OP_DST, - BLIT_OP_SRC_OVER, - BLIT_OP_DST_OVER, BLIT_OP_OVER_REV = BLIT_OP_DST_OVER, - BLIT_OP_SRC_IN, - BLIT_OP_DST_IN, BLIT_OP_IN_REV = BLIT_OP_DST_IN, - BLIT_OP_SRC_OUT, - BLIT_OP_DST_OUT, BLIT_OP_OUT_REV = BLIT_OP_DST_OUT, - BLIT_OP_SRC_ATOP, - BLIT_OP_DST_ATOP, BLIT_OP_ATOP_REV = BLIT_OP_DST_ATOP, - BLIT_OP_XOR, - - BLIT_OP_ADD, - BLIT_OP_MULTIPLY, - BLIT_OP_SCREEN, - BLIT_OP_DARKEN, - BLIT_OP_LIGHTEN, - - BLIT_OP_DISJ_SRC_OVER, - BLIT_OP_DISJ_DST_OVER, BLIT_OP_SATURATE = BLIT_OP_DISJ_DST_OVER, - BLIT_OP_DISJ_SRC_IN, - BLIT_OP_DISJ_DST_IN, BLIT_OP_DISJ_IN_REV = BLIT_OP_DISJ_DST_IN, - BLIT_OP_DISJ_SRC_OUT, - BLIT_OP_DISJ_DST_OUT, BLIT_OP_DISJ_OUT_REV = BLIT_OP_DISJ_DST_OUT, - BLIT_OP_DISJ_SRC_ATOP, - BLIT_OP_DISJ_DST_ATOP, BLIT_OP_DISJ_ATOP_REV = BLIT_OP_DISJ_DST_ATOP, - BLIT_OP_DISJ_XOR, - - BLIT_OP_CONJ_SRC_OVER, - BLIT_OP_CONJ_DST_OVER, BLIT_OP_CONJ_OVER_REV = BLIT_OP_CONJ_DST_OVER, - BLIT_OP_CONJ_SRC_IN, - BLIT_OP_CONJ_DST_IN, BLIT_OP_CONJ_IN_REV = BLIT_OP_CONJ_DST_IN, - BLIT_OP_CONJ_SRC_OUT, - BLIT_OP_CONJ_DST_OUT, BLIT_OP_CONJ_OUT_REV = BLIT_OP_CONJ_DST_OUT, - BLIT_OP_CONJ_SRC_ATOP, - BLIT_OP_CONJ_DST_ATOP, BLIT_OP_CONJ_ATOP_REV = BLIT_OP_CONJ_DST_ATOP, - BLIT_OP_CONJ_XOR, - - /* Add new operation type here */ - - /* user select coefficient manually */ - BLIT_OP_USER_COEFF, - - /* end of blit operation */ - BLIT_OP_END, - - /* driver not supporting format */ - BLIT_OP_NOT_SUPPORTED -}; - -#define MAX_FIMG2D_BLIT_OP (int)BLIT_OP_END - -struct fimg2d_version { - unsigned int hw; - unsigned int sw; -}; - -/** - * @start: start address or unique id of image - * @size: whole length of allocated image - * @cacheable: memory is cacheable - * @pinnable: memory is pinnable. currently not supported. - */ -struct fimg2d_addr { - enum addr_space type; - unsigned long start; - size_t size; - int cacheable; - int pinnable; -}; - -struct fimg2d_rect { - int x1; - int y1; - int x2; /* x1 + width */ - int y2; /* y1 + height */ -}; - -/** - * if factor is percentage, scale_w and scale_h are valid - * if factor is pixels, src_w, src_h, dst_w, dst_h are valid - */ -struct fimg2d_scale { - enum scaling mode; - enum scaling_factor factor; - - /* percentage */ - int scale_w; - int scale_h; - - /* pixels */ - int src_w, src_h; - int dst_w, dst_h; -}; - -/** - * coordinate from start address(0,0) of image - */ -struct fimg2d_clip { - bool enable; - int x1; - int y1; - int x2; /* x1 + width */ - int y2; /* y1 + height */ -}; - -struct fimg2d_repeat { - enum repeat mode; - unsigned long pad_color; -}; - -/** - * @bg_color: bg_color is valid only if bluescreen mode is BLUSCR. - */ -struct fimg2d_bluscr { - enum bluescreen mode; - unsigned long bs_color; - unsigned long bg_color; -}; - -/** - * @plane2: address info for CbCr in YCbCr 2plane mode - */ -struct fimg2d_image { - struct fimg2d_addr addr; - struct fimg2d_addr plane2; - int width; - int height; - int stride; - enum pixel_order order; - enum color_format fmt; -}; - -struct fimg2d_param { - enum blit_op op; - unsigned long fillcolor; - unsigned char g_alpha; - enum premultiplied premult; - bool dither; - enum rotation rotate; - struct fimg2d_scale *scaling; - struct fimg2d_repeat *repeat; - struct fimg2d_bluscr *bluscr; - struct fimg2d_clip *clipping; -}; - -/** - * @g_alpha: 0xff is opaque, 0x0 is transparnet - * @seq_no: used for debugging - */ -struct fimg2d_blit { - enum blit_op op; - - enum premultiplied premult; - unsigned char g_alpha; - bool dither; - enum rotation rotate; - struct fimg2d_scale *scaling; - struct fimg2d_repeat *repeat; - struct fimg2d_bluscr *bluscr; - struct fimg2d_clip *clipping; - - unsigned long solid_color; - struct fimg2d_image *src; - struct fimg2d_image *dst; - struct fimg2d_image *msk; - - struct fimg2d_rect *src_rect; - struct fimg2d_rect *dst_rect; - struct fimg2d_rect *msk_rect; - - unsigned int seq_no; -}; -#endif /* __SEC_G2D_4X_H__ */ -- cgit v1.1