3 ** Copyright 2009 Samsung Electronics Co, Ltd.
4 ** Copyright 2008, The Android Open Source Project
6 ** Licensed under the Apache License, Version 2.0 (the "License");
7 ** you may not use this file except in compliance with the License.
8 ** You may obtain a copy of the License at
10 ** http://www.apache.org/licenses/LICENSE-2.0
12 ** Unless required by applicable law or agreed to in writing, software
13 ** distributed under the License is distributed on an "AS IS" BASIS,
14 ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 ** See the License for the specific language governing permissions and
16 ** limitations under the License.
26 #include <utils/Log.h>
28 #if defined(FIMGAPI_V5X)
29 #include "sec_g2d_5x.h"
31 #include "sec_g2d_4x.h"
34 #undef FIMGAPI_HAL_DEBUG
38 #if defined(REAL_DEBUG)
47 void VOID_FUNC(const char *format
, ...);
49 #define PRINT VOID_FUNC
50 #define PRINTD VOID_FUNC
58 int srcFWStride
; // this is not w, just stride (w * bpp)
63 unsigned char* srcAddr
;
69 int dstFWStride
; // this is not w, just stride (w * bpp)
74 unsigned char* dstAddr
;
82 unsigned int fillcolor
;
94 int called
; /* 0 : drawRect 1 : drawBitmap */
99 struct blitinfo_table
{
104 struct compromise_param
{
114 extern struct blitinfo_table optbl
[];
127 FimgApi(const FimgApi
& rhs __unused
) {}
133 inline bool FlagCreate(void) { return m_flagCreate
; }
134 bool Stretch(struct fimg2d_blit
*cmd
);
135 #ifdef FIMG2D_USE_M2M1SHOT2
136 bool Stretch_v5(struct m2m1shot2
*cmd
);
141 virtual bool t_Create(void);
142 virtual bool t_Destroy(void);
143 virtual bool t_Stretch(struct fimg2d_blit
*cmd
);
144 #ifdef FIMG2D_USE_M2M1SHOT2
145 virtual bool t_Stretch_v5(struct m2m1shot2
*cmd
);
147 virtual bool t_Sync(void);
148 virtual bool t_Lock(void);
149 virtual bool t_UnLock(void);
157 FimgApi
*createFimgApi();
162 void destroyFimgApi(FimgApi
*ptrFimgApi
);
167 int stretchFimgApi(struct fimg2d_blit
*cmd
);
169 #ifdef FIMG2D_USE_M2M1SHOT2
173 int stretchFimgApi_v5(struct m2m1shot2
*cmd
);
179 int stretchFimgApi_fast(struct fimg2d_blit
*cmd
, unsigned long temp_addr
, int temp_size
);
184 bool checkScaleFimgApi(Fimg
*fimg
);
190 int SyncFimgApi(void);
192 int requestFimgApi_v5(struct Fimg
*fimg
);
193 void printDataBlit(char *title
, const char *called
, struct fimg2d_blit
*cmd
);
194 void printDataBlitRotate(int rotate
);
195 void printDataBlitImage(const char *title
, struct fimg2d_image
*image
);
196 void printDataBlitRect(const char *title
, struct fimg2d_rect
*rect
);
197 void printDataBlitRect(const char *title
, struct fimg2d_clip
*clipping
);
198 void printDataBlitScale(struct fimg2d_scale
*scaling
);