gfx_dcdr.c revision 71d7fec4
11.26Sryo/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/gfx_dcdr.c,v 1.1 2002/12/10 15:12:25 alanh Exp $ */
21.1Sitojun/*
31.4Stsubai * $Workfile: gfx_dcdr.c $
41.4Stsubai *
51.4Stsubai * This file contains routines to control the video decoder.
61.4Stsubai *
71.4Stsubai *    gfx_set_decoder_defaults
81.4Stsubai *    gfx_set_decoder_analog_input
91.4Stsubai *    gfx_set_decoder_brightness
101.4Stsubai *    gfx_set_decoder_contrast
111.4Stsubai *    gfx_set_decoder_luminance_filter
121.4Stsubai *    gfx_set_decoder_hue
131.4Stsubai *    gfx_set_decoder_saturation
141.4Stsubai *    gfx_set_decoder_input_offset
151.4Stsubai *    gfx_set_decoder_input_size
161.4Stsubai *    gfx_set_decoder_output_size
171.4Stsubai *    gfx_set_decoder_scale
181.4Stsubai *    gfx_set_decoder_TV_standard
191.4Stsubai *    gfx_set_decoder_vbi_enable
201.4Stsubai *    gfx_set_decoder_vbi_format
211.4Stsubai *    gfx_set_decoder_vbi_upscale
221.4Stsubai *    gfx_decoder_software_reset
231.4Stsubai *    gfx_decoder_detect_macrovision
241.4Stsubai *    gfx_decoder_detect_video
251.4Stsubai *
261.4Stsubai * And the following routines if GFX_READ_ROUTINES is set:
271.1Sitojun *
281.11Slukem *    gfx_get_decoder_brightness
291.11Slukem *    gfx_get_decoder_contrast
301.26Sryo *    gfx_get_decoder_hue
311.1Sitojun *    gfx_get_decoder_saturation
321.1Sitojun *    gfx_get_decoder_input_offset
331.1Sitojun *    gfx_get_decoder_input_size
341.1Sitojun *    gfx_get_decoder_output_size
351.1Sitojun *    gfx_get_decoder_vbi_format
361.1Sitojun *
371.4Stsubai * NSC_LIC_ALTERNATIVE_PREAMBLE
381.4Stsubai *
391.4Stsubai * Revision 1.0
401.26Sryo *
411.1Sitojun * National Semiconductor Alternative GPL-BSD License
421.1Sitojun *
431.1Sitojun * National Semiconductor Corporation licenses this software
441.22Suwe * ("Software"):
451.26Sryo *
461.26Sryo *      Durango
471.26Sryo *
481.26Sryo * under one of the two following licenses, depending on how the
491.26Sryo * Software is received by the Licensee.
501.26Sryo *
511.1Sitojun * If this Software is received as part of the Linux Framebuffer or
521.8Such * other GPL licensed software, then the GPL license designated
531.26Sryo * NSC_LIC_GPL applies to this Software; in all other circumstances
541.26Sryo * then the BSD-style license designated NSC_LIC_BSD shall apply.
551.1Sitojun *
561.6Sjdolecek * END_NSC_LIC_ALTERNATIVE_PREAMBLE */
571.7Such
581.7Such/* NSC_LIC_BSD
591.7Such *
601.7Such * National Semiconductor Corporation Open Source License for Durango
611.7Such *
621.7Such * (BSD License with Export Notice)
631.7Such *
641.7Such * Copyright (c) 1999-2001
651.7Such * National Semiconductor Corporation.
661.7Such * All rights reserved.
671.7Such *
681.7Such * Redistribution and use in source and binary forms, with or without
691.7Such * modification, are permitted provided that the following conditions
701.7Such * are met:
711.7Such *
721.7Such *   * Redistributions of source code must retain the above copyright
731.7Such *     notice, this list of conditions and the following disclaimer.
741.23Suwe *
751.23Suwe *   * Redistributions in binary form must reproduce the above
761.7Such *     copyright notice, this list of conditions and the following
771.7Such *     disclaimer in the documentation and/or other materials provided
781.1Sitojun *     with the distribution.
791.1Sitojun *
801.22Suwe *   * Neither the name of the National Semiconductor Corporation nor
811.22Suwe *     the names of its contributors may be used to endorse or promote
821.26Sryo *     products derived from this software without specific prior
831.26Sryo *     written permission.
841.26Sryo *
851.26Sryo * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
861.26Sryo * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
871.26Sryo * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
881.26Sryo * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
891.26Sryo * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
901.26Sryo * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
911.26Sryo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
921.26Sryo * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
931.26Sryo * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
941.26Sryo * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
951.26Sryo * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
961.26Sryo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
971.1Sitojun * OF SUCH DAMAGE.
981.1Sitojun *
991.20Sthorpej * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
1001.26Sryo * YOUR JURISDICTION. It is licensee's responsibility to comply with
1011.1Sitojun * any export regulations applicable in licensee's jurisdiction. Under
1021.22Suwe * CURRENT (2001) U.S. export regulations this software
1031.26Sryo * is eligible for export from the U.S. and can be downloaded by or
1041.15Suwe * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
1051.24Suwe * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
1061.24Suwe * Syria, Sudan, Afghanistan and any other country to which the U.S.
1071.24Suwe * has embargoed goods and services.
1081.24Suwe *
1091.15Suwe * END_NSC_LIC_BSD */
1101.18Sperry
1111.1Sitojun/* NSC_LIC_GPL
1121.24Suwe *
1131.24Suwe * National Semiconductor Corporation Gnu General Public License for Durango
1141.24Suwe *
1151.24Suwe * (GPL License with Export Notice)
1161.24Suwe *
1171.24Suwe * Copyright (c) 1999-2001
1181.24Suwe * National Semiconductor Corporation.
1191.22Suwe * All rights reserved.
1201.24Suwe *
1211.24Suwe * Redistribution and use in source and binary forms, with or without
1221.24Suwe * modification, are permitted under the terms of the GNU General
1231.24Suwe * Public License as published by the Free Software Foundation; either
1241.24Suwe * version 2 of the License, or (at your option) any later version
1251.24Suwe *
1261.24Suwe * In addition to the terms of the GNU General Public License, neither
1271.24Suwe * the name of the National Semiconductor Corporation nor the names of
1281.22Suwe * its contributors may be used to endorse or promote products derived
1291.24Suwe * from this software without specific prior written permission.
1301.24Suwe *
1311.26Sryo * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1321.26Sryo * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1331.26Sryo * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
1341.26Sryo * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
1351.26Sryo * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY
1361.26Sryo * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1371.26Sryo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
1381.24Suwe * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
1391.26Sryo * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
1401.26Sryo * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE,
1411.26Sryo * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY
1421.26Sryo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
1431.24Suwe * OF SUCH DAMAGE. See the GNU General Public License for more details.
1441.24Suwe *
1451.24Suwe * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF
1461.24Suwe * YOUR JURISDICTION. It is licensee's responsibility to comply with
1471.24Suwe * any export regulations applicable in licensee's jurisdiction. Under
1481.24Suwe * CURRENT (2001) U.S. export regulations this software
1491.24Suwe * is eligible for export from the U.S. and can be downloaded by or
1501.26Sryo * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed
1511.26Sryo * destinations which include Cuba, Iraq, Libya, North Korea, Iran,
1521.26Sryo * Syria, Sudan, Afghanistan and any other country to which the U.S.
1531.24Suwe * has embargoed goods and services.
1541.26Sryo *
1551.26Sryo * You should have received a copy of the GNU General Public License
1561.24Suwe * along with this file; if not, write to the Free Software Foundation,
1571.26Sryo * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
1581.24Suwe *
1591.24Suwe * END_NSC_LIC_GPL */
1601.24Suwe
1611.24Suwe/* INCLUDE SUPPORT FOR PHILIPS SAA7114 DECODER, IF SPECIFIED */
1621.24Suwe
1631.26Sryo#if GFX_DECODER_SAA7114
1641.24Suwe#include "saa7114.c"
1651.24Suwe#endif
1661.26Sryo
1671.26Sryo/* WRAPPERS IF DYNAMIC SELECTION */
1681.26Sryo/* Extra layer to call various decoders.  Currently only the Pillips */
1691.26Sryo/* decoder is supported, but still organized to easily expand later. */
1701.26Sryo
1711.26Sryo#if GFX_DECODER_DYNAMIC
1721.26Sryo
1731.26Sryo/*-----------------------------------------------------------------------------
1741.26Sryo * gfx_set_decoder_defaults
1751.26Sryo *-----------------------------------------------------------------------------
1761.26Sryo */
1771.26Sryoint
1781.26Sryogfx_set_decoder_defaults(void)
1791.26Sryo{
1801.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
1811.26Sryo
1821.26Sryo#	if	GFX_DECODER_SAA7114
1831.22Suwe   if (gfx_decoder_type == GFX_DECODER_SAA7114)
1841.1Sitojun      status = saa7114_set_decoder_defaults();
1851.26Sryo#	endif
1861.26Sryo   return (status);
1871.26Sryo}
1881.26Sryo
1891.15Suwe/*-----------------------------------------------------------------------------
1901.26Sryo * gfx_set_decoder_analog_input
1911.26Sryo *-----------------------------------------------------------------------------
1921.26Sryo */
1931.26Sryoint
1941.22Suwegfx_set_decoder_analog_input(unsigned char input)
1951.26Sryo{
1961.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
1971.26Sryo
1981.26Sryo#	if	GFX_DECODER_SAA7114
1991.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2001.26Sryo      status = saa7114_set_decoder_analog_input(input);
2011.26Sryo#	endif
2021.26Sryo   return (status);
2031.26Sryo}
2041.26Sryo
2051.15Suwe/*-----------------------------------------------------------------------------
2061.26Sryo * gfx_set_decoder_brightness
2071.26Sryo *-----------------------------------------------------------------------------
2081.22Suwe */
2091.15Suweint
2101.15Suwegfx_set_decoder_brightness(unsigned char brightness)
2111.15Suwe{
2121.15Suwe   int status = GFX_STATUS_UNSUPPORTED;
2131.16Schs
2141.15Suwe#	if	GFX_DECODER_SAA7114
2151.15Suwe   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2161.26Sryo      status = saa7114_set_decoder_brightness(brightness);
2171.15Suwe#	endif
2181.26Sryo   return (status);
2191.26Sryo}
2201.26Sryo
2211.26Sryo/*-----------------------------------------------------------------------------
2221.26Sryo * gfx_set_decoder_contrast
2231.26Sryo *-----------------------------------------------------------------------------
2241.15Suwe */
2251.26Sryoint
2261.1Sitojungfx_set_decoder_contrast(unsigned char contrast)
2271.26Sryo{
2281.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
2291.26Sryo
2301.4Stsubai#	if	GFX_DECODER_SAA7114
2311.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2321.26Sryo      status = saa7114_set_decoder_contrast(contrast);
2331.15Suwe#	endif
2341.26Sryo   return (status);
2351.4Stsubai}
2361.26Sryo
2371.26Sryo/*-----------------------------------------------------------------------------
2381.15Suwe * gfx_set_decoder_hue
2391.26Sryo *-----------------------------------------------------------------------------
2401.26Sryo */
2411.26Sryoint
2421.26Sryogfx_set_decoder_hue(char hue)
2431.22Suwe{
2441.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
2451.26Sryo
2461.15Suwe#	if	GFX_DECODER_SAA7114
2471.4Stsubai   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2481.4Stsubai      status = saa7114_set_decoder_hue(hue);
2491.1Sitojun#	endif
2501.1Sitojun   return (status);
2511.1Sitojun}
2521.26Sryo
2531.7Such/*-----------------------------------------------------------------------------
2541.26Sryo * gfx_set_decoder_saturation
2551.26Sryo *-----------------------------------------------------------------------------
2561.26Sryo */
2571.22Suweint
2581.26Sryogfx_set_decoder_saturation(unsigned char saturation)
2591.26Sryo{
2601.1Sitojun   int status = GFX_STATUS_UNSUPPORTED;
2611.26Sryo
2621.26Sryo#	if	GFX_DECODER_SAA7114
2631.4Stsubai   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2641.26Sryo      status = saa7114_set_decoder_saturation(saturation);
2651.26Sryo#	endif
2661.26Sryo   return (status);
2671.26Sryo}
2681.26Sryo
2691.26Sryo/*-----------------------------------------------------------------------------
2701.26Sryo * gfx_set_decoder_input_offset
2711.26Sryo *-----------------------------------------------------------------------------
2721.1Sitojun */
2731.26Sryoint
2741.4Stsubaigfx_set_decoder_input_offset(unsigned short x, unsigned short y)
2751.4Stsubai{
2761.1Sitojun   int status = GFX_STATUS_UNSUPPORTED;
2771.8Such
2781.4Stsubai#	if	GFX_DECODER_SAA7114
2791.1Sitojun   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2801.26Sryo      status = saa7114_set_decoder_input_offset(x, y);
2811.21Sthorpej#	endif
2821.26Sryo   return (status);
2831.26Sryo}
2841.4Stsubai
2851.1Sitojun/*-----------------------------------------------------------------------------
2861.26Sryo * gfx_set_decoder_input_size
2871.22Suwe *-----------------------------------------------------------------------------
2881.22Suwe */
2891.4Stsubaiint
2901.4Stsubaigfx_set_decoder_input_size(unsigned short width, unsigned short height)
2911.1Sitojun{
2921.4Stsubai   int status = GFX_STATUS_UNSUPPORTED;
2931.4Stsubai
2941.4Stsubai#	if	GFX_DECODER_SAA7114
2951.4Stsubai   if (gfx_decoder_type == GFX_DECODER_SAA7114)
2961.1Sitojun      status = saa7114_set_decoder_input_size(width, height);
2971.4Stsubai#	endif
2981.4Stsubai   return (status);
2991.4Stsubai}
3001.4Stsubai
3011.1Sitojun/*-----------------------------------------------------------------------------
3021.4Stsubai * gfx_set_decoder_output_size
3031.4Stsubai *-----------------------------------------------------------------------------
3041.1Sitojun */
3051.1Sitojunint
3061.4Stsubaigfx_set_decoder_output_size(unsigned short width, unsigned short height)
3071.4Stsubai{
3081.1Sitojun   int status = GFX_STATUS_UNSUPPORTED;
3091.4Stsubai
3101.26Sryo#	if	GFX_DECODER_SAA7114
3111.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
3121.26Sryo      status = saa7114_set_decoder_output_size(width, height);
3131.26Sryo#	endif
3141.1Sitojun   return (status);
3151.1Sitojun}
3161.4Stsubai
3171.26Sryo/*-----------------------------------------------------------------------------
3181.4Stsubai * gfx_set_decoder_scale
3191.1Sitojun *-----------------------------------------------------------------------------
3201.5Smsaitoh */
3211.26Sryoint
3221.26Sryogfx_set_decoder_scale(unsigned short srcw, unsigned short srch,
3231.26Sryo		      unsigned short dstw, unsigned short dsth)
3241.26Sryo{
3251.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
3261.5Smsaitoh
3271.26Sryo#	if	GFX_DECODER_SAA7114
3281.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
3291.5Smsaitoh      status = saa7114_set_decoder_scale(srcw, srch, dstw, dsth);
3301.26Sryo#	endif
3311.26Sryo   return (status);
3321.26Sryo}
3331.26Sryo
3341.5Smsaitoh/*-----------------------------------------------------------------------------
3351.26Sryo * gfx_set_decoder_vbi_format
3361.26Sryo *-----------------------------------------------------------------------------
3371.4Stsubai */
3381.5Smsaitohint
3391.5Smsaitohgfx_set_decoder_vbi_format(int start, int end, int format)
3401.5Smsaitoh{
3411.5Smsaitoh   int status = GFX_STATUS_UNSUPPORTED;
3421.5Smsaitoh
3431.22Suwe#	if	GFX_DECODER_SAA7114
3441.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
3451.22Suwe      status = saa7114_set_decoder_vbi_format(start, end, format);
3461.26Sryo#	endif
3471.26Sryo   return (status);
3481.22Suwe}
3491.1Sitojun
3501.1Sitojun/*-----------------------------------------------------------------------------
3511.7Such * gfx_set_decoder_vbi_enable
3521.26Sryo *-----------------------------------------------------------------------------
3531.26Sryo */
3541.26Sryoint
3551.26Sryogfx_set_decoder_vbi_enable(int enable)
3561.26Sryo{
3571.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
3581.26Sryo
3591.26Sryo#	if	GFX_DECODER_SAA7114
3601.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
3611.26Sryo      status = saa7114_set_decoder_vbi_enable(enable);
3621.26Sryo#	endif
3631.26Sryo   return (status);
3641.26Sryo}
3651.26Sryo
3661.26Sryo/*-----------------------------------------------------------------------------
3671.26Sryo * gfx_set_decoder_vbi_upscale
3681.26Sryo *-----------------------------------------------------------------------------
3691.26Sryo */
3701.26Sryoint
3711.26Sryogfx_set_decoder_vbi_upscale(void)
3721.26Sryo{
3731.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
3741.26Sryo
3751.26Sryo#	if	GFX_DECODER_SAA7114
3761.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
3771.26Sryo      status = saa7114_set_decoder_vbi_upscale();
3781.4Stsubai#	endif
3791.26Sryo   return (status);
3801.26Sryo}
3811.26Sryo
3821.26Sryo/*-----------------------------------------------------------------------------
3831.26Sryo * gfx_set_decoder_TV_standard
3841.26Sryo *-----------------------------------------------------------------------------
3851.26Sryo */
3861.26Sryoint
3871.26Sryogfx_set_decoder_TV_standard(TVStandardType TVStandard)
3881.26Sryo{
3891.26Sryo   int status = GFX_STATUS_UNSUPPORTED;
3901.26Sryo
3911.26Sryo#	if	GFX_DECODER_SAA7114
3921.26Sryo   if (gfx_decoder_type == GFX_DECODER_SAA7114)
3931.26Sryo      status = saa7114_set_decoder_TV_standard(TVStandard);
3941.26Sryo#	endif
3951.4Stsubai   return (status);
3961.26Sryo}
3971.26Sryo
3981.26Sryo/*-----------------------------------------------------------------------------
3991.1Sitojun * gfx_set_decoder_luminance_filter
400 *-----------------------------------------------------------------------------
401 */
402int
403gfx_set_decoder_luminance_filter(unsigned char lufi)
404{
405   int status = GFX_STATUS_UNSUPPORTED;
406
407#	if	GFX_DECODER_SAA7114
408   if (gfx_decoder_type == GFX_DECODER_SAA7114)
409      status = saa7114_set_decoder_luminance_filter(lufi);
410#	endif
411   return (status);
412}
413
414/*-----------------------------------------------------------------------------
415 * gfx_decoder_software_reset
416 *-----------------------------------------------------------------------------
417 */
418int
419gfx_decoder_software_reset(void)
420{
421   int status = GFX_STATUS_UNSUPPORTED;
422
423#	if	GFX_DECODER_SAA7114
424   if (gfx_decoder_type == GFX_DECODER_SAA7114)
425      status = saa7114_decoder_software_reset();
426#	endif
427   return (status);
428}
429
430/*-----------------------------------------------------------------------------
431 * gfx_decoder_detect_macrovision
432 *-----------------------------------------------------------------------------
433 */
434int
435gfx_decoder_detect_macrovision(void)
436{
437   int status = GFX_STATUS_UNSUPPORTED;
438
439#	if	GFX_DECODER_SAA7114
440   if (gfx_decoder_type == GFX_DECODER_SAA7114)
441      status = saa7114_decoder_detect_macrovision();
442#	endif
443   return (status);
444}
445
446/*-----------------------------------------------------------------------------
447 * gfx_decoder_detect_video
448 *-----------------------------------------------------------------------------
449 */
450int
451gfx_decoder_detect_video(void)
452{
453   int status = GFX_STATUS_UNSUPPORTED;
454
455#	if	GFX_DECODER_SAA7114
456   if (gfx_decoder_type == GFX_DECODER_SAA7114)
457      status = saa7114_decoder_detect_video();
458#	endif
459   return (status);
460}
461
462/*************************************************************/
463/*  READ ROUTINES  |  INCLUDED FOR DIAGNOSTIC PURPOSES ONLY  */
464/*************************************************************/
465
466#if GFX_READ_ROUTINES
467
468/*-----------------------------------------------------------------------------
469 * gfx_get_decoder_brightness
470 *-----------------------------------------------------------------------------
471 */
472unsigned char
473gfx_get_decoder_brightness(void)
474{
475   unsigned char brightness = 0;
476
477#	if	GFX_DECODER_SAA7114
478   if (gfx_decoder_type == GFX_DECODER_SAA7114)
479      brightness = saa7114_get_decoder_brightness();
480#	endif
481   return (brightness);
482}
483
484/*-----------------------------------------------------------------------------
485 * gfx_get_decoder_contrast
486 *-----------------------------------------------------------------------------
487 */
488unsigned char
489gfx_get_decoder_contrast(void)
490{
491   unsigned char contrast = 0;
492
493#	if	GFX_DECODER_SAA7114
494   if (gfx_decoder_type == GFX_DECODER_SAA7114)
495      contrast = saa7114_get_decoder_contrast();
496#	endif
497   return (contrast);
498}
499
500/*-----------------------------------------------------------------------------
501 * gfx_get_decoder_hue
502 *-----------------------------------------------------------------------------
503 */
504char
505gfx_get_decoder_hue(void)
506{
507   unsigned char hue = 0;
508
509#	if	GFX_DECODER_SAA7114
510   if (gfx_decoder_type == GFX_DECODER_SAA7114)
511      hue = saa7114_get_decoder_hue();
512#	endif
513   return ((char)hue);
514}
515
516/*-----------------------------------------------------------------------------
517 * gfx_get_decoder_saturation
518 *-----------------------------------------------------------------------------
519 */
520unsigned char
521gfx_get_decoder_saturation(void)
522{
523   unsigned char saturation = 0;
524
525#	if	GFX_DECODER_SAA7114
526   if (gfx_decoder_type == GFX_DECODER_SAA7114)
527      saturation = saa7114_get_decoder_saturation();
528#	endif
529   return (saturation);
530}
531
532/*-----------------------------------------------------------------------------
533 * gfx_get_decoder_input_offset
534 *-----------------------------------------------------------------------------
535 */
536unsigned long
537gfx_get_decoder_input_offset()
538{
539   unsigned long offset = 0;
540
541#	if	GFX_DECODER_SAA7114
542   if (gfx_decoder_type == GFX_DECODER_SAA7114)
543      offset = saa7114_get_decoder_input_offset();
544#	endif
545   return (offset);
546}
547
548/*-----------------------------------------------------------------------------
549 * gfx_get_decoder_input_size
550 *-----------------------------------------------------------------------------
551 */
552unsigned long
553gfx_get_decoder_input_size()
554{
555   unsigned long size = 0;
556
557#	if	GFX_DECODER_SAA7114
558   if (gfx_decoder_type == GFX_DECODER_SAA7114)
559      size = saa7114_get_decoder_input_size();
560#	endif
561   return (size);
562}
563
564/*-----------------------------------------------------------------------------
565 * gfx_get_decoder_output_size
566 *-----------------------------------------------------------------------------
567 */
568unsigned long
569gfx_get_decoder_output_size()
570{
571   unsigned long size = 0;
572
573#	if	GFX_DECODER_SAA7114
574   if (gfx_decoder_type == GFX_DECODER_SAA7114)
575      size = saa7114_get_decoder_output_size();
576#	endif
577   return (size);
578}
579
580/*-----------------------------------------------------------------------------
581 * gfx_get_decoder_vbi_format
582 *-----------------------------------------------------------------------------
583 */
584int
585gfx_get_decoder_vbi_format(int line)
586{
587   int format = 0;
588
589#	if	GFX_DECODER_SAA7114
590   if (gfx_decoder_type == GFX_DECODER_SAA7114)
591      format = saa7114_get_decoder_vbi_format(line);
592#	endif
593   return (format);
594}
595
596#endif /* GFX_READ_ROUTINES */
597
598#endif /* GFX_DECODER_DYNAMIC */
599
600/* END OF FILE */
601