/* Copyright (c) 2007, 2013 The Linux Foundation. All rights reserved. * Copyright (C) 2007 Google Incorporated * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and * may be copied, distributed, and modified under those terms. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ #ifndef MDP3_PPP_H #define MDP3_PPP_H #include "mdp3.h" #include "mdss_fb.h" #define PPP_WRITEL(val, off) MDP3_REG_WRITE(off, val) #define MAX_BLIT_REQ 16 #define PPP_UPSCALE_MAX 64 #define PPP_BLUR_SCALE_MAX 128 #define PPP_LUT_MAX 256 /* MDP PPP Operations */ #define MDPOP_NOP 0 #define MDPOP_LR BIT(0) /* left to right flip */ #define MDPOP_UD BIT(1) /* up and down flip */ #define MDPOP_ROT90 BIT(2) /* rotate image to 90 degree */ #define MDPOP_ROT180 (MDPOP_UD|MDPOP_LR) #define MDPOP_ROT270 (MDPOP_ROT90|MDPOP_UD|MDPOP_LR) #define MDPOP_ASCALE BIT(7) #define MDPOP_ALPHAB BIT(8) /* enable alpha blending */ #define MDPOP_TRANSP BIT(9) /* enable transparency */ #define MDPOP_DITHER BIT(10) /* enable dither */ #define MDPOP_SHARPENING BIT(11) /* enable sharpening */ #define MDPOP_BLUR BIT(12) /* enable blur */ #define MDPOP_FG_PM_ALPHA BIT(13) #define MDPOP_LAYER_IS_FG BIT(14) #define MDPOP_ROTATION (MDPOP_ROT90|MDPOP_LR|MDPOP_UD) #define PPP_OP_CONVERT_YCBCR2RGB BIT(2) #define PPP_OP_CONVERT_ON BIT(3) #define PPP_OP_SCALE_X_ON BIT(0) #define PPP_OP_SCALE_Y_ON BIT(1) #define PPP_OP_ROT_ON BIT(8) #define PPP_OP_ROT_90 BIT(9) #define PPP_OP_FLIP_LR BIT(10) #define PPP_OP_FLIP_UD BIT(11) #define PPP_OP_BLEND_ON BIT(12) #define PPP_OP_BLEND_CONSTANT_ALPHA BIT(14) #define PPP_OP_DITHER_EN BIT(16) #define PPP_BLEND_CALPHA_TRNASP BIT(24) #define PPP_OP_BLEND_SRCPIXEL_ALPHA 0 #define PPP_OP_BLEND_ALPHA_BLEND_NORMAL 0 #define PPP_OP_BLEND_ALPHA_BLEND_REVERSE BIT(15) #define PPP_BLEND_BG_USE_ALPHA_SEL (1 << 0) #define PPP_BLEND_BG_ALPHA_REVERSE (1 << 3) #define PPP_BLEND_BG_SRCPIXEL_ALPHA (0 << 1) #define PPP_BLEND_BG_DSTPIXEL_ALPHA (1 << 1) #define PPP_BLEND_BG_CONSTANT_ALPHA (2 << 1) #define PPP_BLEND_BG_CONST_ALPHA_VAL(x) ((x) << 24) #define PPP_OP_BG_CHROMA_H2V1 BIT(25) #define CLR_G 0x0 #define CLR_B 0x1 #define CLR_R 0x2 #define CLR_ALPHA 0x3 #define CLR_Y CLR_G #define CLR_CB CLR_B #define CLR_CR CLR_R /* from lsb to msb */ #define PPP_GET_PACK_PATTERN(a, x, y, z, bit) \ (((a)<<(bit*3))|((x)<<(bit*2))|((y)<