1*4882a593Smuzhiyun /* SPDX-License-Identifier: LGPL-2.1+ WITH Linux-syscall-note */ 2*4882a593Smuzhiyun /* 3*4882a593Smuzhiyun * osd.h - DEPRECATED On Screen Display API 4*4882a593Smuzhiyun * 5*4882a593Smuzhiyun * NOTE: should not be used on future drivers 6*4882a593Smuzhiyun * 7*4882a593Smuzhiyun * Copyright (C) 2001 Ralph Metzler <ralph@convergence.de> 8*4882a593Smuzhiyun * & Marcus Metzler <marcus@convergence.de> 9*4882a593Smuzhiyun * for convergence integrated media GmbH 10*4882a593Smuzhiyun * 11*4882a593Smuzhiyun * This program is free software; you can redistribute it and/or 12*4882a593Smuzhiyun * modify it under the terms of the GNU General Lesser Public License 13*4882a593Smuzhiyun * as published by the Free Software Foundation; either version 2.1 14*4882a593Smuzhiyun * of the License, or (at your option) any later version. 15*4882a593Smuzhiyun * 16*4882a593Smuzhiyun * This program is distributed in the hope that it will be useful, 17*4882a593Smuzhiyun * but WITHOUT ANY WARRANTY; without even the implied warranty of 18*4882a593Smuzhiyun * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19*4882a593Smuzhiyun * GNU General Public License for more details. 20*4882a593Smuzhiyun * 21*4882a593Smuzhiyun * You should have received a copy of the GNU Lesser General Public License 22*4882a593Smuzhiyun * along with this program; if not, write to the Free Software 23*4882a593Smuzhiyun * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 24*4882a593Smuzhiyun * 25*4882a593Smuzhiyun */ 26*4882a593Smuzhiyun 27*4882a593Smuzhiyun #ifndef _DVBOSD_H_ 28*4882a593Smuzhiyun #define _DVBOSD_H_ 29*4882a593Smuzhiyun 30*4882a593Smuzhiyun #include <linux/compiler.h> 31*4882a593Smuzhiyun 32*4882a593Smuzhiyun typedef enum { 33*4882a593Smuzhiyun /* All functions return -2 on "not open" */ 34*4882a593Smuzhiyun OSD_Close = 1, /* () */ 35*4882a593Smuzhiyun /* 36*4882a593Smuzhiyun * Disables OSD and releases the buffers 37*4882a593Smuzhiyun * returns 0 on success 38*4882a593Smuzhiyun */ 39*4882a593Smuzhiyun OSD_Open, /* (x0,y0,x1,y1,BitPerPixel[2/4/8](color&0x0F),mix[0..15](color&0xF0)) */ 40*4882a593Smuzhiyun /* 41*4882a593Smuzhiyun * Opens OSD with this size and bit depth 42*4882a593Smuzhiyun * returns 0 on success, -1 on DRAM allocation error, -2 on "already open" 43*4882a593Smuzhiyun */ 44*4882a593Smuzhiyun OSD_Show, /* () */ 45*4882a593Smuzhiyun /* 46*4882a593Smuzhiyun * enables OSD mode 47*4882a593Smuzhiyun * returns 0 on success 48*4882a593Smuzhiyun */ 49*4882a593Smuzhiyun OSD_Hide, /* () */ 50*4882a593Smuzhiyun /* 51*4882a593Smuzhiyun * disables OSD mode 52*4882a593Smuzhiyun * returns 0 on success 53*4882a593Smuzhiyun */ 54*4882a593Smuzhiyun OSD_Clear, /* () */ 55*4882a593Smuzhiyun /* 56*4882a593Smuzhiyun * Sets all pixel to color 0 57*4882a593Smuzhiyun * returns 0 on success 58*4882a593Smuzhiyun */ 59*4882a593Smuzhiyun OSD_Fill, /* (color) */ 60*4882a593Smuzhiyun /* 61*4882a593Smuzhiyun * Sets all pixel to color <col> 62*4882a593Smuzhiyun * returns 0 on success 63*4882a593Smuzhiyun */ 64*4882a593Smuzhiyun OSD_SetColor, /* (color,R{x0},G{y0},B{x1},opacity{y1}) */ 65*4882a593Smuzhiyun /* 66*4882a593Smuzhiyun * set palette entry <num> to <r,g,b>, <mix> and <trans> apply 67*4882a593Smuzhiyun * R,G,B: 0..255 68*4882a593Smuzhiyun * R=Red, G=Green, B=Blue 69*4882a593Smuzhiyun * opacity=0: pixel opacity 0% (only video pixel shows) 70*4882a593Smuzhiyun * opacity=1..254: pixel opacity as specified in header 71*4882a593Smuzhiyun * opacity=255: pixel opacity 100% (only OSD pixel shows) 72*4882a593Smuzhiyun * returns 0 on success, -1 on error 73*4882a593Smuzhiyun */ 74*4882a593Smuzhiyun OSD_SetPalette, /* (firstcolor{color},lastcolor{x0},data) */ 75*4882a593Smuzhiyun /* 76*4882a593Smuzhiyun * Set a number of entries in the palette 77*4882a593Smuzhiyun * sets the entries "firstcolor" through "lastcolor" from the array "data" 78*4882a593Smuzhiyun * data has 4 byte for each color: 79*4882a593Smuzhiyun * R,G,B, and a opacity value: 0->transparent, 1..254->mix, 255->pixel 80*4882a593Smuzhiyun */ 81*4882a593Smuzhiyun OSD_SetTrans, /* (transparency{color}) */ 82*4882a593Smuzhiyun /* 83*4882a593Smuzhiyun * Sets transparency of mixed pixel (0..15) 84*4882a593Smuzhiyun * returns 0 on success 85*4882a593Smuzhiyun */ 86*4882a593Smuzhiyun OSD_SetPixel, /* (x0,y0,color) */ 87*4882a593Smuzhiyun /* 88*4882a593Smuzhiyun * sets pixel <x>,<y> to color number <col> 89*4882a593Smuzhiyun * returns 0 on success, -1 on error 90*4882a593Smuzhiyun */ 91*4882a593Smuzhiyun OSD_GetPixel, /* (x0,y0) */ 92*4882a593Smuzhiyun /* returns color number of pixel <x>,<y>, or -1 */ 93*4882a593Smuzhiyun OSD_SetRow, /* (x0,y0,x1,data) */ 94*4882a593Smuzhiyun /* 95*4882a593Smuzhiyun * fills pixels x0,y through x1,y with the content of data[] 96*4882a593Smuzhiyun * returns 0 on success, -1 on clipping all pixel (no pixel drawn) 97*4882a593Smuzhiyun */ 98*4882a593Smuzhiyun OSD_SetBlock, /* (x0,y0,x1,y1,increment{color},data) */ 99*4882a593Smuzhiyun /* 100*4882a593Smuzhiyun * fills pixels x0,y0 through x1,y1 with the content of data[] 101*4882a593Smuzhiyun * inc contains the width of one line in the data block, 102*4882a593Smuzhiyun * inc<=0 uses blockwidth as linewidth 103*4882a593Smuzhiyun * returns 0 on success, -1 on clipping all pixel 104*4882a593Smuzhiyun */ 105*4882a593Smuzhiyun OSD_FillRow, /* (x0,y0,x1,color) */ 106*4882a593Smuzhiyun /* 107*4882a593Smuzhiyun * fills pixels x0,y through x1,y with the color <col> 108*4882a593Smuzhiyun * returns 0 on success, -1 on clipping all pixel 109*4882a593Smuzhiyun */ 110*4882a593Smuzhiyun OSD_FillBlock, /* (x0,y0,x1,y1,color) */ 111*4882a593Smuzhiyun /* 112*4882a593Smuzhiyun * fills pixels x0,y0 through x1,y1 with the color <col> 113*4882a593Smuzhiyun * returns 0 on success, -1 on clipping all pixel 114*4882a593Smuzhiyun */ 115*4882a593Smuzhiyun OSD_Line, /* (x0,y0,x1,y1,color) */ 116*4882a593Smuzhiyun /* 117*4882a593Smuzhiyun * draw a line from x0,y0 to x1,y1 with the color <col> 118*4882a593Smuzhiyun * returns 0 on success 119*4882a593Smuzhiyun */ 120*4882a593Smuzhiyun OSD_Query, /* (x0,y0,x1,y1,xasp{color}}), yasp=11 */ 121*4882a593Smuzhiyun /* 122*4882a593Smuzhiyun * fills parameters with the picture dimensions and the pixel aspect ratio 123*4882a593Smuzhiyun * returns 0 on success 124*4882a593Smuzhiyun */ 125*4882a593Smuzhiyun OSD_Test, /* () */ 126*4882a593Smuzhiyun /* 127*4882a593Smuzhiyun * draws a test picture. for debugging purposes only 128*4882a593Smuzhiyun * returns 0 on success 129*4882a593Smuzhiyun * TODO: remove "test" in final version 130*4882a593Smuzhiyun */ 131*4882a593Smuzhiyun OSD_Text, /* (x0,y0,size,color,text) */ 132*4882a593Smuzhiyun OSD_SetWindow, /* (x0) set window with number 0<x0<8 as current */ 133*4882a593Smuzhiyun OSD_MoveWindow, /* move current window to (x0, y0) */ 134*4882a593Smuzhiyun OSD_OpenRaw, /* Open other types of OSD windows */ 135*4882a593Smuzhiyun } OSD_Command; 136*4882a593Smuzhiyun 137*4882a593Smuzhiyun typedef struct osd_cmd_s { 138*4882a593Smuzhiyun OSD_Command cmd; 139*4882a593Smuzhiyun int x0; 140*4882a593Smuzhiyun int y0; 141*4882a593Smuzhiyun int x1; 142*4882a593Smuzhiyun int y1; 143*4882a593Smuzhiyun int color; 144*4882a593Smuzhiyun void __user *data; 145*4882a593Smuzhiyun } osd_cmd_t; 146*4882a593Smuzhiyun 147*4882a593Smuzhiyun /* OSD_OpenRaw: set 'color' to desired window type */ 148*4882a593Smuzhiyun typedef enum { 149*4882a593Smuzhiyun OSD_BITMAP1, /* 1 bit bitmap */ 150*4882a593Smuzhiyun OSD_BITMAP2, /* 2 bit bitmap */ 151*4882a593Smuzhiyun OSD_BITMAP4, /* 4 bit bitmap */ 152*4882a593Smuzhiyun OSD_BITMAP8, /* 8 bit bitmap */ 153*4882a593Smuzhiyun OSD_BITMAP1HR, /* 1 Bit bitmap half resolution */ 154*4882a593Smuzhiyun OSD_BITMAP2HR, /* 2 bit bitmap half resolution */ 155*4882a593Smuzhiyun OSD_BITMAP4HR, /* 4 bit bitmap half resolution */ 156*4882a593Smuzhiyun OSD_BITMAP8HR, /* 8 bit bitmap half resolution */ 157*4882a593Smuzhiyun OSD_YCRCB422, /* 4:2:2 YCRCB Graphic Display */ 158*4882a593Smuzhiyun OSD_YCRCB444, /* 4:4:4 YCRCB Graphic Display */ 159*4882a593Smuzhiyun OSD_YCRCB444HR, /* 4:4:4 YCRCB graphic half resolution */ 160*4882a593Smuzhiyun OSD_VIDEOTSIZE, /* True Size Normal MPEG Video Display */ 161*4882a593Smuzhiyun OSD_VIDEOHSIZE, /* MPEG Video Display Half Resolution */ 162*4882a593Smuzhiyun OSD_VIDEOQSIZE, /* MPEG Video Display Quarter Resolution */ 163*4882a593Smuzhiyun OSD_VIDEODSIZE, /* MPEG Video Display Double Resolution */ 164*4882a593Smuzhiyun OSD_VIDEOTHSIZE, /* True Size MPEG Video Display Half Resolution */ 165*4882a593Smuzhiyun OSD_VIDEOTQSIZE, /* True Size MPEG Video Display Quarter Resolution*/ 166*4882a593Smuzhiyun OSD_VIDEOTDSIZE, /* True Size MPEG Video Display Double Resolution */ 167*4882a593Smuzhiyun OSD_VIDEONSIZE, /* Full Size MPEG Video Display */ 168*4882a593Smuzhiyun OSD_CURSOR /* Cursor */ 169*4882a593Smuzhiyun } osd_raw_window_t; 170*4882a593Smuzhiyun 171*4882a593Smuzhiyun typedef struct osd_cap_s { 172*4882a593Smuzhiyun int cmd; 173*4882a593Smuzhiyun #define OSD_CAP_MEMSIZE 1 /* memory size */ 174*4882a593Smuzhiyun long val; 175*4882a593Smuzhiyun } osd_cap_t; 176*4882a593Smuzhiyun 177*4882a593Smuzhiyun 178*4882a593Smuzhiyun #define OSD_SEND_CMD _IOW('o', 160, osd_cmd_t) 179*4882a593Smuzhiyun #define OSD_GET_CAPABILITY _IOR('o', 161, osd_cap_t) 180*4882a593Smuzhiyun 181*4882a593Smuzhiyun #endif 182