171d7fec4Smrg/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/gfx_dcdr.c,v 1.1 2002/12/10 15:12:25 alanh Exp $ */ 271d7fec4Smrg/* 371d7fec4Smrg * $Workfile: gfx_dcdr.c $ 471d7fec4Smrg * 571d7fec4Smrg * This file contains routines to control the video decoder. 671d7fec4Smrg * 771d7fec4Smrg * gfx_set_decoder_defaults 871d7fec4Smrg * gfx_set_decoder_analog_input 971d7fec4Smrg * gfx_set_decoder_brightness 1071d7fec4Smrg * gfx_set_decoder_contrast 1171d7fec4Smrg * gfx_set_decoder_luminance_filter 1271d7fec4Smrg * gfx_set_decoder_hue 1371d7fec4Smrg * gfx_set_decoder_saturation 1471d7fec4Smrg * gfx_set_decoder_input_offset 1571d7fec4Smrg * gfx_set_decoder_input_size 1671d7fec4Smrg * gfx_set_decoder_output_size 1771d7fec4Smrg * gfx_set_decoder_scale 1871d7fec4Smrg * gfx_set_decoder_TV_standard 1971d7fec4Smrg * gfx_set_decoder_vbi_enable 2071d7fec4Smrg * gfx_set_decoder_vbi_format 2171d7fec4Smrg * gfx_set_decoder_vbi_upscale 2271d7fec4Smrg * gfx_decoder_software_reset 2371d7fec4Smrg * gfx_decoder_detect_macrovision 2471d7fec4Smrg * gfx_decoder_detect_video 2571d7fec4Smrg * 2671d7fec4Smrg * And the following routines if GFX_READ_ROUTINES is set: 2771d7fec4Smrg * 2871d7fec4Smrg * gfx_get_decoder_brightness 2971d7fec4Smrg * gfx_get_decoder_contrast 3071d7fec4Smrg * gfx_get_decoder_hue 3171d7fec4Smrg * gfx_get_decoder_saturation 3271d7fec4Smrg * gfx_get_decoder_input_offset 3371d7fec4Smrg * gfx_get_decoder_input_size 3471d7fec4Smrg * gfx_get_decoder_output_size 3571d7fec4Smrg * gfx_get_decoder_vbi_format 3671d7fec4Smrg * 3771d7fec4Smrg * NSC_LIC_ALTERNATIVE_PREAMBLE 3871d7fec4Smrg * 3971d7fec4Smrg * Revision 1.0 4071d7fec4Smrg * 4171d7fec4Smrg * National Semiconductor Alternative GPL-BSD License 4271d7fec4Smrg * 4371d7fec4Smrg * National Semiconductor Corporation licenses this software 4471d7fec4Smrg * ("Software"): 4571d7fec4Smrg * 4671d7fec4Smrg * Durango 4771d7fec4Smrg * 4871d7fec4Smrg * under one of the two following licenses, depending on how the 4971d7fec4Smrg * Software is received by the Licensee. 5071d7fec4Smrg * 5171d7fec4Smrg * If this Software is received as part of the Linux Framebuffer or 5271d7fec4Smrg * other GPL licensed software, then the GPL license designated 5371d7fec4Smrg * NSC_LIC_GPL applies to this Software; in all other circumstances 5471d7fec4Smrg * then the BSD-style license designated NSC_LIC_BSD shall apply. 5571d7fec4Smrg * 5671d7fec4Smrg * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ 5771d7fec4Smrg 5871d7fec4Smrg/* NSC_LIC_BSD 5971d7fec4Smrg * 6071d7fec4Smrg * National Semiconductor Corporation Open Source License for Durango 6171d7fec4Smrg * 6271d7fec4Smrg * (BSD License with Export Notice) 6371d7fec4Smrg * 6471d7fec4Smrg * Copyright (c) 1999-2001 6571d7fec4Smrg * National Semiconductor Corporation. 6671d7fec4Smrg * All rights reserved. 6771d7fec4Smrg * 6871d7fec4Smrg * Redistribution and use in source and binary forms, with or without 6971d7fec4Smrg * modification, are permitted provided that the following conditions 7071d7fec4Smrg * are met: 7171d7fec4Smrg * 7271d7fec4Smrg * * Redistributions of source code must retain the above copyright 7371d7fec4Smrg * notice, this list of conditions and the following disclaimer. 7471d7fec4Smrg * 7571d7fec4Smrg * * Redistributions in binary form must reproduce the above 7671d7fec4Smrg * copyright notice, this list of conditions and the following 7771d7fec4Smrg * disclaimer in the documentation and/or other materials provided 7871d7fec4Smrg * with the distribution. 7971d7fec4Smrg * 8071d7fec4Smrg * * Neither the name of the National Semiconductor Corporation nor 8171d7fec4Smrg * the names of its contributors may be used to endorse or promote 8271d7fec4Smrg * products derived from this software without specific prior 8371d7fec4Smrg * written permission. 8471d7fec4Smrg * 8571d7fec4Smrg * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 8671d7fec4Smrg * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8771d7fec4Smrg * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 8871d7fec4Smrg * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 8971d7fec4Smrg * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 9071d7fec4Smrg * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 9171d7fec4Smrg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 9271d7fec4Smrg * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 9371d7fec4Smrg * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 9471d7fec4Smrg * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 9571d7fec4Smrg * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 9671d7fec4Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 9771d7fec4Smrg * OF SUCH DAMAGE. 9871d7fec4Smrg * 9971d7fec4Smrg * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 10071d7fec4Smrg * YOUR JURISDICTION. It is licensee's responsibility to comply with 10171d7fec4Smrg * any export regulations applicable in licensee's jurisdiction. Under 10271d7fec4Smrg * CURRENT (2001) U.S. export regulations this software 10371d7fec4Smrg * is eligible for export from the U.S. and can be downloaded by or 10471d7fec4Smrg * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 10571d7fec4Smrg * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 10671d7fec4Smrg * Syria, Sudan, Afghanistan and any other country to which the U.S. 10771d7fec4Smrg * has embargoed goods and services. 10871d7fec4Smrg * 10971d7fec4Smrg * END_NSC_LIC_BSD */ 11071d7fec4Smrg 11171d7fec4Smrg/* NSC_LIC_GPL 11271d7fec4Smrg * 11371d7fec4Smrg * National Semiconductor Corporation Gnu General Public License for Durango 11471d7fec4Smrg * 11571d7fec4Smrg * (GPL License with Export Notice) 11671d7fec4Smrg * 11771d7fec4Smrg * Copyright (c) 1999-2001 11871d7fec4Smrg * National Semiconductor Corporation. 11971d7fec4Smrg * All rights reserved. 12071d7fec4Smrg * 12171d7fec4Smrg * Redistribution and use in source and binary forms, with or without 12271d7fec4Smrg * modification, are permitted under the terms of the GNU General 12371d7fec4Smrg * Public License as published by the Free Software Foundation; either 12471d7fec4Smrg * version 2 of the License, or (at your option) any later version 12571d7fec4Smrg * 12671d7fec4Smrg * In addition to the terms of the GNU General Public License, neither 12771d7fec4Smrg * the name of the National Semiconductor Corporation nor the names of 12871d7fec4Smrg * its contributors may be used to endorse or promote products derived 12971d7fec4Smrg * from this software without specific prior written permission. 13071d7fec4Smrg * 13171d7fec4Smrg * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 13271d7fec4Smrg * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 13371d7fec4Smrg * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 13471d7fec4Smrg * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 13571d7fec4Smrg * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 13671d7fec4Smrg * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 13771d7fec4Smrg * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 13871d7fec4Smrg * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 13971d7fec4Smrg * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 14071d7fec4Smrg * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 14171d7fec4Smrg * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 14271d7fec4Smrg * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 14371d7fec4Smrg * OF SUCH DAMAGE. See the GNU General Public License for more details. 14471d7fec4Smrg * 14571d7fec4Smrg * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 14671d7fec4Smrg * YOUR JURISDICTION. It is licensee's responsibility to comply with 14771d7fec4Smrg * any export regulations applicable in licensee's jurisdiction. Under 14871d7fec4Smrg * CURRENT (2001) U.S. export regulations this software 14971d7fec4Smrg * is eligible for export from the U.S. and can be downloaded by or 15071d7fec4Smrg * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 15171d7fec4Smrg * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 15271d7fec4Smrg * Syria, Sudan, Afghanistan and any other country to which the U.S. 15371d7fec4Smrg * has embargoed goods and services. 15471d7fec4Smrg * 15571d7fec4Smrg * You should have received a copy of the GNU General Public License 15671d7fec4Smrg * along with this file; if not, write to the Free Software Foundation, 15771d7fec4Smrg * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 15871d7fec4Smrg * 15971d7fec4Smrg * END_NSC_LIC_GPL */ 16071d7fec4Smrg 16171d7fec4Smrg/* INCLUDE SUPPORT FOR PHILIPS SAA7114 DECODER, IF SPECIFIED */ 16271d7fec4Smrg 16371d7fec4Smrg#if GFX_DECODER_SAA7114 16471d7fec4Smrg#include "saa7114.c" 16571d7fec4Smrg#endif 16671d7fec4Smrg 16771d7fec4Smrg/* WRAPPERS IF DYNAMIC SELECTION */ 16871d7fec4Smrg/* Extra layer to call various decoders. Currently only the Pillips */ 16971d7fec4Smrg/* decoder is supported, but still organized to easily expand later. */ 17071d7fec4Smrg 17171d7fec4Smrg#if GFX_DECODER_DYNAMIC 17271d7fec4Smrg 17371d7fec4Smrg/*----------------------------------------------------------------------------- 17471d7fec4Smrg * gfx_set_decoder_defaults 17571d7fec4Smrg *----------------------------------------------------------------------------- 17671d7fec4Smrg */ 17771d7fec4Smrgint 17871d7fec4Smrggfx_set_decoder_defaults(void) 17971d7fec4Smrg{ 18071d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 18171d7fec4Smrg 18271d7fec4Smrg# if GFX_DECODER_SAA7114 18371d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 18471d7fec4Smrg status = saa7114_set_decoder_defaults(); 18571d7fec4Smrg# endif 18671d7fec4Smrg return (status); 18771d7fec4Smrg} 18871d7fec4Smrg 18971d7fec4Smrg/*----------------------------------------------------------------------------- 19071d7fec4Smrg * gfx_set_decoder_analog_input 19171d7fec4Smrg *----------------------------------------------------------------------------- 19271d7fec4Smrg */ 19371d7fec4Smrgint 19471d7fec4Smrggfx_set_decoder_analog_input(unsigned char input) 19571d7fec4Smrg{ 19671d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 19771d7fec4Smrg 19871d7fec4Smrg# if GFX_DECODER_SAA7114 19971d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 20071d7fec4Smrg status = saa7114_set_decoder_analog_input(input); 20171d7fec4Smrg# endif 20271d7fec4Smrg return (status); 20371d7fec4Smrg} 20471d7fec4Smrg 20571d7fec4Smrg/*----------------------------------------------------------------------------- 20671d7fec4Smrg * gfx_set_decoder_brightness 20771d7fec4Smrg *----------------------------------------------------------------------------- 20871d7fec4Smrg */ 20971d7fec4Smrgint 21071d7fec4Smrggfx_set_decoder_brightness(unsigned char brightness) 21171d7fec4Smrg{ 21271d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 21371d7fec4Smrg 21471d7fec4Smrg# if GFX_DECODER_SAA7114 21571d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 21671d7fec4Smrg status = saa7114_set_decoder_brightness(brightness); 21771d7fec4Smrg# endif 21871d7fec4Smrg return (status); 21971d7fec4Smrg} 22071d7fec4Smrg 22171d7fec4Smrg/*----------------------------------------------------------------------------- 22271d7fec4Smrg * gfx_set_decoder_contrast 22371d7fec4Smrg *----------------------------------------------------------------------------- 22471d7fec4Smrg */ 22571d7fec4Smrgint 22671d7fec4Smrggfx_set_decoder_contrast(unsigned char contrast) 22771d7fec4Smrg{ 22871d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 22971d7fec4Smrg 23071d7fec4Smrg# if GFX_DECODER_SAA7114 23171d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 23271d7fec4Smrg status = saa7114_set_decoder_contrast(contrast); 23371d7fec4Smrg# endif 23471d7fec4Smrg return (status); 23571d7fec4Smrg} 23671d7fec4Smrg 23771d7fec4Smrg/*----------------------------------------------------------------------------- 23871d7fec4Smrg * gfx_set_decoder_hue 23971d7fec4Smrg *----------------------------------------------------------------------------- 24071d7fec4Smrg */ 24171d7fec4Smrgint 24271d7fec4Smrggfx_set_decoder_hue(char hue) 24371d7fec4Smrg{ 24471d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 24571d7fec4Smrg 24671d7fec4Smrg# if GFX_DECODER_SAA7114 24771d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 24871d7fec4Smrg status = saa7114_set_decoder_hue(hue); 24971d7fec4Smrg# endif 25071d7fec4Smrg return (status); 25171d7fec4Smrg} 25271d7fec4Smrg 25371d7fec4Smrg/*----------------------------------------------------------------------------- 25471d7fec4Smrg * gfx_set_decoder_saturation 25571d7fec4Smrg *----------------------------------------------------------------------------- 25671d7fec4Smrg */ 25771d7fec4Smrgint 25871d7fec4Smrggfx_set_decoder_saturation(unsigned char saturation) 25971d7fec4Smrg{ 26071d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 26171d7fec4Smrg 26271d7fec4Smrg# if GFX_DECODER_SAA7114 26371d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 26471d7fec4Smrg status = saa7114_set_decoder_saturation(saturation); 26571d7fec4Smrg# endif 26671d7fec4Smrg return (status); 26771d7fec4Smrg} 26871d7fec4Smrg 26971d7fec4Smrg/*----------------------------------------------------------------------------- 27071d7fec4Smrg * gfx_set_decoder_input_offset 27171d7fec4Smrg *----------------------------------------------------------------------------- 27271d7fec4Smrg */ 27371d7fec4Smrgint 27471d7fec4Smrggfx_set_decoder_input_offset(unsigned short x, unsigned short y) 27571d7fec4Smrg{ 27671d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 27771d7fec4Smrg 27871d7fec4Smrg# if GFX_DECODER_SAA7114 27971d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 28071d7fec4Smrg status = saa7114_set_decoder_input_offset(x, y); 28171d7fec4Smrg# endif 28271d7fec4Smrg return (status); 28371d7fec4Smrg} 28471d7fec4Smrg 28571d7fec4Smrg/*----------------------------------------------------------------------------- 28671d7fec4Smrg * gfx_set_decoder_input_size 28771d7fec4Smrg *----------------------------------------------------------------------------- 28871d7fec4Smrg */ 28971d7fec4Smrgint 29071d7fec4Smrggfx_set_decoder_input_size(unsigned short width, unsigned short height) 29171d7fec4Smrg{ 29271d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 29371d7fec4Smrg 29471d7fec4Smrg# if GFX_DECODER_SAA7114 29571d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 29671d7fec4Smrg status = saa7114_set_decoder_input_size(width, height); 29771d7fec4Smrg# endif 29871d7fec4Smrg return (status); 29971d7fec4Smrg} 30071d7fec4Smrg 30171d7fec4Smrg/*----------------------------------------------------------------------------- 30271d7fec4Smrg * gfx_set_decoder_output_size 30371d7fec4Smrg *----------------------------------------------------------------------------- 30471d7fec4Smrg */ 30571d7fec4Smrgint 30671d7fec4Smrggfx_set_decoder_output_size(unsigned short width, unsigned short height) 30771d7fec4Smrg{ 30871d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 30971d7fec4Smrg 31071d7fec4Smrg# if GFX_DECODER_SAA7114 31171d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 31271d7fec4Smrg status = saa7114_set_decoder_output_size(width, height); 31371d7fec4Smrg# endif 31471d7fec4Smrg return (status); 31571d7fec4Smrg} 31671d7fec4Smrg 31771d7fec4Smrg/*----------------------------------------------------------------------------- 31871d7fec4Smrg * gfx_set_decoder_scale 31971d7fec4Smrg *----------------------------------------------------------------------------- 32071d7fec4Smrg */ 32171d7fec4Smrgint 32271d7fec4Smrggfx_set_decoder_scale(unsigned short srcw, unsigned short srch, 32371d7fec4Smrg unsigned short dstw, unsigned short dsth) 32471d7fec4Smrg{ 32571d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 32671d7fec4Smrg 32771d7fec4Smrg# if GFX_DECODER_SAA7114 32871d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 32971d7fec4Smrg status = saa7114_set_decoder_scale(srcw, srch, dstw, dsth); 33071d7fec4Smrg# endif 33171d7fec4Smrg return (status); 33271d7fec4Smrg} 33371d7fec4Smrg 33471d7fec4Smrg/*----------------------------------------------------------------------------- 33571d7fec4Smrg * gfx_set_decoder_vbi_format 33671d7fec4Smrg *----------------------------------------------------------------------------- 33771d7fec4Smrg */ 33871d7fec4Smrgint 33971d7fec4Smrggfx_set_decoder_vbi_format(int start, int end, int format) 34071d7fec4Smrg{ 34171d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 34271d7fec4Smrg 34371d7fec4Smrg# if GFX_DECODER_SAA7114 34471d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 34571d7fec4Smrg status = saa7114_set_decoder_vbi_format(start, end, format); 34671d7fec4Smrg# endif 34771d7fec4Smrg return (status); 34871d7fec4Smrg} 34971d7fec4Smrg 35071d7fec4Smrg/*----------------------------------------------------------------------------- 35171d7fec4Smrg * gfx_set_decoder_vbi_enable 35271d7fec4Smrg *----------------------------------------------------------------------------- 35371d7fec4Smrg */ 35471d7fec4Smrgint 35571d7fec4Smrggfx_set_decoder_vbi_enable(int enable) 35671d7fec4Smrg{ 35771d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 35871d7fec4Smrg 35971d7fec4Smrg# if GFX_DECODER_SAA7114 36071d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 36171d7fec4Smrg status = saa7114_set_decoder_vbi_enable(enable); 36271d7fec4Smrg# endif 36371d7fec4Smrg return (status); 36471d7fec4Smrg} 36571d7fec4Smrg 36671d7fec4Smrg/*----------------------------------------------------------------------------- 36771d7fec4Smrg * gfx_set_decoder_vbi_upscale 36871d7fec4Smrg *----------------------------------------------------------------------------- 36971d7fec4Smrg */ 37071d7fec4Smrgint 37171d7fec4Smrggfx_set_decoder_vbi_upscale(void) 37271d7fec4Smrg{ 37371d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 37471d7fec4Smrg 37571d7fec4Smrg# if GFX_DECODER_SAA7114 37671d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 37771d7fec4Smrg status = saa7114_set_decoder_vbi_upscale(); 37871d7fec4Smrg# endif 37971d7fec4Smrg return (status); 38071d7fec4Smrg} 38171d7fec4Smrg 38271d7fec4Smrg/*----------------------------------------------------------------------------- 38371d7fec4Smrg * gfx_set_decoder_TV_standard 38471d7fec4Smrg *----------------------------------------------------------------------------- 38571d7fec4Smrg */ 38671d7fec4Smrgint 38771d7fec4Smrggfx_set_decoder_TV_standard(TVStandardType TVStandard) 38871d7fec4Smrg{ 38971d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 39071d7fec4Smrg 39171d7fec4Smrg# if GFX_DECODER_SAA7114 39271d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 39371d7fec4Smrg status = saa7114_set_decoder_TV_standard(TVStandard); 39471d7fec4Smrg# endif 39571d7fec4Smrg return (status); 39671d7fec4Smrg} 39771d7fec4Smrg 39871d7fec4Smrg/*----------------------------------------------------------------------------- 39971d7fec4Smrg * gfx_set_decoder_luminance_filter 40071d7fec4Smrg *----------------------------------------------------------------------------- 40171d7fec4Smrg */ 40271d7fec4Smrgint 40371d7fec4Smrggfx_set_decoder_luminance_filter(unsigned char lufi) 40471d7fec4Smrg{ 40571d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 40671d7fec4Smrg 40771d7fec4Smrg# if GFX_DECODER_SAA7114 40871d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 40971d7fec4Smrg status = saa7114_set_decoder_luminance_filter(lufi); 41071d7fec4Smrg# endif 41171d7fec4Smrg return (status); 41271d7fec4Smrg} 41371d7fec4Smrg 41471d7fec4Smrg/*----------------------------------------------------------------------------- 41571d7fec4Smrg * gfx_decoder_software_reset 41671d7fec4Smrg *----------------------------------------------------------------------------- 41771d7fec4Smrg */ 41871d7fec4Smrgint 41971d7fec4Smrggfx_decoder_software_reset(void) 42071d7fec4Smrg{ 42171d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 42271d7fec4Smrg 42371d7fec4Smrg# if GFX_DECODER_SAA7114 42471d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 42571d7fec4Smrg status = saa7114_decoder_software_reset(); 42671d7fec4Smrg# endif 42771d7fec4Smrg return (status); 42871d7fec4Smrg} 42971d7fec4Smrg 43071d7fec4Smrg/*----------------------------------------------------------------------------- 43171d7fec4Smrg * gfx_decoder_detect_macrovision 43271d7fec4Smrg *----------------------------------------------------------------------------- 43371d7fec4Smrg */ 43471d7fec4Smrgint 43571d7fec4Smrggfx_decoder_detect_macrovision(void) 43671d7fec4Smrg{ 43771d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 43871d7fec4Smrg 43971d7fec4Smrg# if GFX_DECODER_SAA7114 44071d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 44171d7fec4Smrg status = saa7114_decoder_detect_macrovision(); 44271d7fec4Smrg# endif 44371d7fec4Smrg return (status); 44471d7fec4Smrg} 44571d7fec4Smrg 44671d7fec4Smrg/*----------------------------------------------------------------------------- 44771d7fec4Smrg * gfx_decoder_detect_video 44871d7fec4Smrg *----------------------------------------------------------------------------- 44971d7fec4Smrg */ 45071d7fec4Smrgint 45171d7fec4Smrggfx_decoder_detect_video(void) 45271d7fec4Smrg{ 45371d7fec4Smrg int status = GFX_STATUS_UNSUPPORTED; 45471d7fec4Smrg 45571d7fec4Smrg# if GFX_DECODER_SAA7114 45671d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 45771d7fec4Smrg status = saa7114_decoder_detect_video(); 45871d7fec4Smrg# endif 45971d7fec4Smrg return (status); 46071d7fec4Smrg} 46171d7fec4Smrg 46271d7fec4Smrg/*************************************************************/ 46371d7fec4Smrg/* READ ROUTINES | INCLUDED FOR DIAGNOSTIC PURPOSES ONLY */ 46471d7fec4Smrg/*************************************************************/ 46571d7fec4Smrg 46671d7fec4Smrg#if GFX_READ_ROUTINES 46771d7fec4Smrg 46871d7fec4Smrg/*----------------------------------------------------------------------------- 46971d7fec4Smrg * gfx_get_decoder_brightness 47071d7fec4Smrg *----------------------------------------------------------------------------- 47171d7fec4Smrg */ 47271d7fec4Smrgunsigned char 47371d7fec4Smrggfx_get_decoder_brightness(void) 47471d7fec4Smrg{ 47571d7fec4Smrg unsigned char brightness = 0; 47671d7fec4Smrg 47771d7fec4Smrg# if GFX_DECODER_SAA7114 47871d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 47971d7fec4Smrg brightness = saa7114_get_decoder_brightness(); 48071d7fec4Smrg# endif 48171d7fec4Smrg return (brightness); 48271d7fec4Smrg} 48371d7fec4Smrg 48471d7fec4Smrg/*----------------------------------------------------------------------------- 48571d7fec4Smrg * gfx_get_decoder_contrast 48671d7fec4Smrg *----------------------------------------------------------------------------- 48771d7fec4Smrg */ 48871d7fec4Smrgunsigned char 48971d7fec4Smrggfx_get_decoder_contrast(void) 49071d7fec4Smrg{ 49171d7fec4Smrg unsigned char contrast = 0; 49271d7fec4Smrg 49371d7fec4Smrg# if GFX_DECODER_SAA7114 49471d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 49571d7fec4Smrg contrast = saa7114_get_decoder_contrast(); 49671d7fec4Smrg# endif 49771d7fec4Smrg return (contrast); 49871d7fec4Smrg} 49971d7fec4Smrg 50071d7fec4Smrg/*----------------------------------------------------------------------------- 50171d7fec4Smrg * gfx_get_decoder_hue 50271d7fec4Smrg *----------------------------------------------------------------------------- 50371d7fec4Smrg */ 50471d7fec4Smrgchar 50571d7fec4Smrggfx_get_decoder_hue(void) 50671d7fec4Smrg{ 50771d7fec4Smrg unsigned char hue = 0; 50871d7fec4Smrg 50971d7fec4Smrg# if GFX_DECODER_SAA7114 51071d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 51171d7fec4Smrg hue = saa7114_get_decoder_hue(); 51271d7fec4Smrg# endif 51371d7fec4Smrg return ((char)hue); 51471d7fec4Smrg} 51571d7fec4Smrg 51671d7fec4Smrg/*----------------------------------------------------------------------------- 51771d7fec4Smrg * gfx_get_decoder_saturation 51871d7fec4Smrg *----------------------------------------------------------------------------- 51971d7fec4Smrg */ 52071d7fec4Smrgunsigned char 52171d7fec4Smrggfx_get_decoder_saturation(void) 52271d7fec4Smrg{ 52371d7fec4Smrg unsigned char saturation = 0; 52471d7fec4Smrg 52571d7fec4Smrg# if GFX_DECODER_SAA7114 52671d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 52771d7fec4Smrg saturation = saa7114_get_decoder_saturation(); 52871d7fec4Smrg# endif 52971d7fec4Smrg return (saturation); 53071d7fec4Smrg} 53171d7fec4Smrg 53271d7fec4Smrg/*----------------------------------------------------------------------------- 53371d7fec4Smrg * gfx_get_decoder_input_offset 53471d7fec4Smrg *----------------------------------------------------------------------------- 53571d7fec4Smrg */ 53671d7fec4Smrgunsigned long 53771d7fec4Smrggfx_get_decoder_input_offset() 53871d7fec4Smrg{ 53971d7fec4Smrg unsigned long offset = 0; 54071d7fec4Smrg 54171d7fec4Smrg# if GFX_DECODER_SAA7114 54271d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 54371d7fec4Smrg offset = saa7114_get_decoder_input_offset(); 54471d7fec4Smrg# endif 54571d7fec4Smrg return (offset); 54671d7fec4Smrg} 54771d7fec4Smrg 54871d7fec4Smrg/*----------------------------------------------------------------------------- 54971d7fec4Smrg * gfx_get_decoder_input_size 55071d7fec4Smrg *----------------------------------------------------------------------------- 55171d7fec4Smrg */ 55271d7fec4Smrgunsigned long 55371d7fec4Smrggfx_get_decoder_input_size() 55471d7fec4Smrg{ 55571d7fec4Smrg unsigned long size = 0; 55671d7fec4Smrg 55771d7fec4Smrg# if GFX_DECODER_SAA7114 55871d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 55971d7fec4Smrg size = saa7114_get_decoder_input_size(); 56071d7fec4Smrg# endif 56171d7fec4Smrg return (size); 56271d7fec4Smrg} 56371d7fec4Smrg 56471d7fec4Smrg/*----------------------------------------------------------------------------- 56571d7fec4Smrg * gfx_get_decoder_output_size 56671d7fec4Smrg *----------------------------------------------------------------------------- 56771d7fec4Smrg */ 56871d7fec4Smrgunsigned long 56971d7fec4Smrggfx_get_decoder_output_size() 57071d7fec4Smrg{ 57171d7fec4Smrg unsigned long size = 0; 57271d7fec4Smrg 57371d7fec4Smrg# if GFX_DECODER_SAA7114 57471d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 57571d7fec4Smrg size = saa7114_get_decoder_output_size(); 57671d7fec4Smrg# endif 57771d7fec4Smrg return (size); 57871d7fec4Smrg} 57971d7fec4Smrg 58071d7fec4Smrg/*----------------------------------------------------------------------------- 58171d7fec4Smrg * gfx_get_decoder_vbi_format 58271d7fec4Smrg *----------------------------------------------------------------------------- 58371d7fec4Smrg */ 58471d7fec4Smrgint 58571d7fec4Smrggfx_get_decoder_vbi_format(int line) 58671d7fec4Smrg{ 58771d7fec4Smrg int format = 0; 58871d7fec4Smrg 58971d7fec4Smrg# if GFX_DECODER_SAA7114 59071d7fec4Smrg if (gfx_decoder_type == GFX_DECODER_SAA7114) 59171d7fec4Smrg format = saa7114_get_decoder_vbi_format(line); 59271d7fec4Smrg# endif 59371d7fec4Smrg return (format); 59471d7fec4Smrg} 59571d7fec4Smrg 59671d7fec4Smrg#endif /* GFX_READ_ROUTINES */ 59771d7fec4Smrg 59871d7fec4Smrg#endif /* GFX_DECODER_DYNAMIC */ 59971d7fec4Smrg 60071d7fec4Smrg/* END OF FILE */ 601