1/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/nsc/gfx/gfx_tv.c,v 1.1 2002/12/10 15:12:25 alanh Exp $ */ 2/* 3 * $Workfile: gfx_tv.c $ 4 * 5 * This file contains routines to program TVOUT and TV encoder. 6 * 7 * Routines: 8 * 9 * gfx_set_tv_format 10 * gfx_set_tv_output 11 * gfx_set_tv_enable 12 * gfx_set_tv_flicker_filter 13 * gfx_set_tv_sub_carrier_reset 14 * gfx_set_tv_vphase 15 * gfx_set_tv_YC_delay 16 * gfx_set_tvenc_reset_interval 17 * gfx_set_tv_cc_enable 18 * gfx_set_tv_cc_data 19 * gfx_test_tvout_odd_field 20 * gfx_test_tvenc_odd_field 21 * gfx_set_tv_field_status_invert 22 * gfx_get_tv_vphase 23 * 24 * NSC_LIC_ALTERNATIVE_PREAMBLE 25 * 26 * Revision 1.0 27 * 28 * National Semiconductor Alternative GPL-BSD License 29 * 30 * National Semiconductor Corporation licenses this software 31 * ("Software"): 32 * 33 * Durango 34 * 35 * under one of the two following licenses, depending on how the 36 * Software is received by the Licensee. 37 * 38 * If this Software is received as part of the Linux Framebuffer or 39 * other GPL licensed software, then the GPL license designated 40 * NSC_LIC_GPL applies to this Software; in all other circumstances 41 * then the BSD-style license designated NSC_LIC_BSD shall apply. 42 * 43 * END_NSC_LIC_ALTERNATIVE_PREAMBLE */ 44 45/* NSC_LIC_BSD 46 * 47 * National Semiconductor Corporation Open Source License for Durango 48 * 49 * (BSD License with Export Notice) 50 * 51 * Copyright (c) 1999-2001 52 * National Semiconductor Corporation. 53 * All rights reserved. 54 * 55 * Redistribution and use in source and binary forms, with or without 56 * modification, are permitted provided that the following conditions 57 * are met: 58 * 59 * * Redistributions of source code must retain the above copyright 60 * notice, this list of conditions and the following disclaimer. 61 * 62 * * Redistributions in binary form must reproduce the above 63 * copyright notice, this list of conditions and the following 64 * disclaimer in the documentation and/or other materials provided 65 * with the distribution. 66 * 67 * * Neither the name of the National Semiconductor Corporation nor 68 * the names of its contributors may be used to endorse or promote 69 * products derived from this software without specific prior 70 * written permission. 71 * 72 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 73 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 74 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 75 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 76 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 77 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 78 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 79 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 80 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 81 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 82 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 83 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 84 * OF SUCH DAMAGE. 85 * 86 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 87 * YOUR JURISDICTION. It is licensee's responsibility to comply with 88 * any export regulations applicable in licensee's jurisdiction. Under 89 * CURRENT (2001) U.S. export regulations this software 90 * is eligible for export from the U.S. and can be downloaded by or 91 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 92 * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 93 * Syria, Sudan, Afghanistan and any other country to which the U.S. 94 * has embargoed goods and services. 95 * 96 * END_NSC_LIC_BSD */ 97 98/* NSC_LIC_GPL 99 * 100 * National Semiconductor Corporation Gnu General Public License for Durango 101 * 102 * (GPL License with Export Notice) 103 * 104 * Copyright (c) 1999-2001 105 * National Semiconductor Corporation. 106 * All rights reserved. 107 * 108 * Redistribution and use in source and binary forms, with or without 109 * modification, are permitted under the terms of the GNU General 110 * Public License as published by the Free Software Foundation; either 111 * version 2 of the License, or (at your option) any later version 112 * 113 * In addition to the terms of the GNU General Public License, neither 114 * the name of the National Semiconductor Corporation nor the names of 115 * its contributors may be used to endorse or promote products derived 116 * from this software without specific prior written permission. 117 * 118 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 119 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 120 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 121 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 122 * NATIONAL SEMICONDUCTOR CORPORATION OR CONTRIBUTORS BE LIABLE FOR ANY 123 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 124 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 125 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 126 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER 127 * IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE, 128 * INTELLECTUAL PROPERTY INFRINGEMENT, OR OTHERWISE) ARISING IN ANY WAY 129 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY 130 * OF SUCH DAMAGE. See the GNU General Public License for more details. 131 * 132 * EXPORT LAWS: THIS LICENSE ADDS NO RESTRICTIONS TO THE EXPORT LAWS OF 133 * YOUR JURISDICTION. It is licensee's responsibility to comply with 134 * any export regulations applicable in licensee's jurisdiction. Under 135 * CURRENT (2001) U.S. export regulations this software 136 * is eligible for export from the U.S. and can be downloaded by or 137 * otherwise exported or reexported worldwide EXCEPT to U.S. embargoed 138 * destinations which include Cuba, Iraq, Libya, North Korea, Iran, 139 * Syria, Sudan, Afghanistan and any other country to which the U.S. 140 * has embargoed goods and services. 141 * 142 * You should have received a copy of the GNU General Public License 143 * along with this file; if not, write to the Free Software Foundation, 144 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 145 * 146 * END_NSC_LIC_GPL */ 147 148/* TV TIMINGS */ 149 150DISPLAYMODE TVTimings[] = { 151 152/* NTSC resolution */ 153 154 {0x3 | /* negative syncs */ 155 GFX_MODE_TV_NTSC, /* NTSC format */ 156 640, 640, 656, 744, 792, 792, /* horizontal timings */ 157 480, 480, 490, 492, 517, 525, /* vertical timings */ 158 0x0018EC4D, /* freq = 24.923052 MHz */ 159 } 160 , 161 162/* PAL resolution */ 163 164 {0x3 | /* negative syncs */ 165 GFX_MODE_TV_PAL, /* PAL format */ 166 768, 768, 800, 848, 864, 864, /* horizontal timings */ 167 576, 576, 586, 588, 625, 625, /* vertical timings */ 168 0x001B0000, /* freq = 27.00 MHz */ 169 } 170 , 171 172/* NTSC resolution non-square pixels */ 173 174 {0x3 | /* negative syncs */ 175 GFX_MODE_TV_NTSC, /* NTSC format */ 176 720, 720, 736, 752, 792, 792, /* horizontal timings */ 177 480, 480, 490, 492, 517, 525, /* vertical timings */ 178 0x0018EC4D, /* freq = 24.923052 MHz */ 179 } 180 , 181 182/* PAL resolution non-square pixels */ 183 184 {0x3 | /* negative syncs */ 185 GFX_MODE_TV_PAL, /* PAL format */ 186 720, 720, 752, 816, 864, 864, /* horizontal timings */ 187 576, 576, 586, 588, 625, 625, /* vertical timings */ 188 0x001B0000, /* freq = 27.00 MHz */ 189 } 190}; 191 192#define NUM_TV_MODES sizeof(TVTimings)/sizeof(DISPLAYMODE) 193 194/* INCLUDE SUPPORT FOR SC1200 TV ENCODER, IF SPECIFIED */ 195 196#if GFX_TV_SC1200 197#include "tv_1200.c" 198#endif 199 200/* INCLUDE SUPPORT FOR FS450 TV ENCODER, IF SPECIFIED */ 201 202#if GFX_TV_FS451 203#include "tv_fs450.c" 204#endif 205 206/* WRAPPERS IF DYNAMIC SELECTION */ 207/* Extra layer to call either SC1200 or FS450 TV encoder routines. */ 208 209#if GFX_TV_DYNAMIC 210 211/*----------------------------------------------------------------------------- 212 * gfx_set_tv_format 213 *----------------------------------------------------------------------------- 214 */ 215int 216gfx_set_tv_format(TVStandardType format, GfxOnTVType resolution) 217{ 218 int retval = GFX_STATUS_UNSUPPORTED; 219 220#if GFX_TV_SC1200 221 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 222 retval = sc1200_set_tv_format(format, resolution); 223#endif 224#if GFX_TV_FS451 225 if (gfx_tv_type & GFX_TV_TYPE_FS451) 226 retval = fs450_set_tv_format(format, resolution); 227#endif 228 return (retval); 229} 230 231/*----------------------------------------------------------------------------- 232 * gfx_set_tv_output 233 *----------------------------------------------------------------------------- 234 */ 235int 236gfx_set_tv_output(int output) 237{ 238 int retval = GFX_STATUS_UNSUPPORTED; 239 240#if GFX_TV_SC1200 241 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 242 retval = sc1200_set_tv_output(output); 243#endif 244#if GFX_TV_FS451 245 if (gfx_tv_type & GFX_TV_TYPE_FS451) 246 retval = fs450_set_tv_output(output); 247#endif 248 return (retval); 249} 250 251/*----------------------------------------------------------------------------- 252 * gfx_set_tv_enable 253 *----------------------------------------------------------------------------- 254 */ 255int 256gfx_set_tv_enable(int enable) 257{ 258 int retval = GFX_STATUS_UNSUPPORTED; 259 260#if GFX_TV_SC1200 261 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 262 retval = sc1200_set_tv_enable(enable); 263#endif 264#if GFX_TV_FS451 265 if (gfx_tv_type & GFX_TV_TYPE_FS451) 266 retval = fs450_set_tv_enable(enable); 267#endif 268 return (retval); 269} 270 271/*----------------------------------------------------------------------------- 272 * gfx_set_tv_flicker_filter 273 *----------------------------------------------------------------------------- 274 */ 275int 276gfx_set_tv_flicker_filter(int ff) 277{ 278 int retval = GFX_STATUS_UNSUPPORTED; 279 280#if GFX_TV_SC1200 281 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 282 retval = sc1200_set_tv_flicker_filter(ff); 283#endif 284 return (retval); 285} 286 287/*----------------------------------------------------------------------------- 288 * gfx_set_tv_sub_carrier_reset 289 *----------------------------------------------------------------------------- 290 */ 291int 292gfx_set_tv_sub_carrier_reset(int screset) 293{ 294 int retval = GFX_STATUS_UNSUPPORTED; 295 296#if GFX_TV_SC1200 297 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 298 retval = sc1200_set_tv_sub_carrier_reset(screset); 299#endif 300 return (retval); 301} 302 303/*----------------------------------------------------------------------------- 304 * gfx_set_tv_vphase 305 *----------------------------------------------------------------------------- 306 */ 307int 308gfx_set_tv_vphase(int vphase) 309{ 310 int retval = GFX_STATUS_UNSUPPORTED; 311 312#if GFX_TV_SC1200 313 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 314 retval = sc1200_set_tv_vphase(vphase); 315#endif 316 return (retval); 317} 318 319/*----------------------------------------------------------------------------- 320 * gfx_set_tv_YC_delay 321 *----------------------------------------------------------------------------- 322 */ 323int 324gfx_set_tv_YC_delay(int delay) 325{ 326 int retval = GFX_STATUS_UNSUPPORTED; 327 328#if GFX_TV_SC1200 329 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 330 retval = sc1200_set_tv_YC_delay(delay); 331#endif 332 return (retval); 333} 334 335/*----------------------------------------------------------------------------- 336 * gfx_set_tvenc_reset_interval 337 *----------------------------------------------------------------------------- 338 */ 339int 340gfx_set_tvenc_reset_interval(int interval) 341{ 342 int retval = GFX_STATUS_UNSUPPORTED; 343 344#if GFX_TV_SC1200 345 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 346 retval = sc1200_set_tvenc_reset_interval(interval); 347#endif 348 return (retval); 349} 350 351/*----------------------------------------------------------------------------- 352 * gfx_set_tv_cc_enable 353 *----------------------------------------------------------------------------- 354 */ 355int 356gfx_set_tv_cc_enable(int enable) 357{ 358 int retval = GFX_STATUS_UNSUPPORTED; 359 360#if GFX_TV_SC1200 361 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 362 retval = sc1200_set_tv_cc_enable(enable); 363#endif 364 return (retval); 365} 366 367/*----------------------------------------------------------------------------- 368 * gfx_set_tv_cc_data 369 * 370 * This routine writes the two specified characters to the CC data register 371 * of the TV encoder. 372 *----------------------------------------------------------------------------- 373 */ 374int 375gfx_set_tv_cc_data(unsigned char data1, unsigned char data2) 376{ 377 int retval = GFX_STATUS_UNSUPPORTED; 378 379#if GFX_TV_SC1200 380 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 381 retval = sc1200_set_tv_cc_data(data1, data2); 382#endif 383 return (retval); 384} 385 386/*--------------------------------------------------------------------------- 387 * gfx_set_tv_display 388 * 389 * Set the timings in the display controller to support a TV resolution. 390 *--------------------------------------------------------------------------- 391 */ 392int 393gfx_set_tv_display(int width, int height) 394{ 395 int status = GFX_STATUS_UNSUPPORTED; 396 397# if GFX_TV_SC1200 398 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 399 status = sc1200_set_tv_display(width, height); 400# endif 401 return (status); 402} 403 404/*--------------------------------------------------------------------------- 405 * gfx_test_tvout_odd_field 406 *--------------------------------------------------------------------------- 407 */ 408int 409gfx_test_tvout_odd_field(void) 410{ 411 int status = GFX_STATUS_UNSUPPORTED; 412 413# if GFX_TV_SC1200 414 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 415 status = sc1200_test_tvout_odd_field(); 416# endif 417 return (status); 418} 419 420/*--------------------------------------------------------------------------- 421 * gfx_test_tvenc_odd_field 422 *--------------------------------------------------------------------------- 423 */ 424int 425gfx_test_tvenc_odd_field(void) 426{ 427 int status = GFX_STATUS_UNSUPPORTED; 428 429# if GFX_TV_SC1200 430 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 431 status = sc1200_test_tvenc_odd_field(); 432# endif 433 return (status); 434} 435 436/*----------------------------------------------------------------------------- 437 * gfx_set_tv_field_status_invert 438 *----------------------------------------------------------------------------- 439 */ 440int 441gfx_set_tv_field_status_invert(int enable) 442{ 443 int retval = GFX_STATUS_UNSUPPORTED; 444 445#if GFX_TV_SC1200 446 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 447 retval = sc1200_set_tv_field_status_invert(enable); 448#endif 449 return (retval); 450} 451 452/*--------------------------------------------------------------------------- 453 * gfx_get_tv_vphase 454 *--------------------------------------------------------------------------- 455 */ 456int 457gfx_get_tv_vphase(void) 458{ 459 int status = GFX_STATUS_UNSUPPORTED; 460 461# if GFX_TV_SC1200 462 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 463 status = sc1200_get_tv_vphase(); 464# endif 465 return (status); 466} 467 468/*--------------------------------------------------------------------------- 469 * gfx_get_tv_enable 470 *--------------------------------------------------------------------------- 471 */ 472int 473gfx_get_tv_enable(unsigned int *p_on) 474{ 475 int retval = -1; 476 477# if GFX_TV_FS451 478 if (gfx_tv_type & GFX_TV_TYPE_FS451) 479 retval = fs450_get_tv_enable(p_on); 480# endif 481# if GFX_TV_SC1200 482 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 483 retval = sc1200_get_tv_enable(p_on); 484# endif 485 return (retval); 486} 487 488/*--------------------------------------------------------------------------- 489 * gfx_get_tv_output 490 *--------------------------------------------------------------------------- 491 */ 492int 493gfx_get_tv_output() 494{ 495 int retval = -1; 496 497# if GFX_TV_SC1200 498 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 499 retval = sc1200_get_tv_output(); 500# endif 501 return (retval); 502} 503 504/*--------------------------------------------------------------------------- 505 * gfx_get_tv_mode_count 506 *--------------------------------------------------------------------------- 507 */ 508int 509gfx_get_tv_mode_count(TVStandardType format) 510{ 511 int retval = -1; 512 513# if GFX_TV_SC1200 514 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 515 retval = sc1200_get_tv_mode_count(format); 516# endif 517 return (retval); 518} 519 520/*--------------------------------------------------------------------------- 521 * gfx_get_tv_display_mode 522 *--------------------------------------------------------------------------- 523 */ 524int 525gfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz) 526{ 527 int retval = -1; 528 529# if GFX_TV_SC1200 530 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 531 retval = sc1200_get_tv_display_mode(width, height, bpp, hz); 532# endif 533 return (retval); 534} 535 536/*--------------------------------------------------------------------------- 537 * gfx_get_tv_display_mode_frequency 538 *--------------------------------------------------------------------------- 539 */ 540int 541gfx_get_tv_display_mode_frequency(unsigned short width, unsigned short height, 542 TVStandardType format, int *frequency) 543{ 544 int retval = -1; 545 546# if GFX_TV_SC1200 547 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 548 retval = 549 sc1200_get_tv_display_mode_frequency(width, height, format, 550 frequency); 551# endif 552 return (retval); 553} 554 555/*--------------------------------------------------------------------------- 556 * gfx_is_tv_display_mode_supported 557 *--------------------------------------------------------------------------- 558 */ 559int 560gfx_is_tv_display_mode_supported(unsigned short width, unsigned short height, 561 TVStandardType format) 562{ 563 int retval = -1; 564 565# if GFX_TV_SC1200 566 if (gfx_tv_type & GFX_TV_TYPE_SC1200) 567 retval = sc1200_is_tv_display_mode_supported(width, height, format); 568# endif 569 return (retval); 570} 571 572/*------------------------------------------ 573 * The following functions were added to support 574 * the FS450 and will eventually be removed. There 575 * is no equivalent support in the SC1200. 576 *----------------------------------------------*/ 577 578/* 579// ========================================================================== 580// 581// TV standard 582*/ 583 584int 585gfx_get_tv_standard(unsigned long *p_standard) 586{ 587 int retval = -1; 588 589#if GFX_TV_FS451 590 if (gfx_tv_type & GFX_TV_TYPE_FS451) 591 retval = fs450_get_tv_standard(p_standard); 592#endif 593 return (retval); 594} 595 596int 597gfx_get_available_tv_standards(unsigned long *p_standards) 598{ 599 int retval = -1; 600 601#if GFX_TV_FS451 602 if (gfx_tv_type & GFX_TV_TYPE_FS451) 603 retval = fs450_get_available_tv_standards(p_standards); 604#endif 605 return (retval); 606} 607 608int 609gfx_set_tv_standard(unsigned long standard) 610{ 611 int retval = -1; 612 613#if GFX_TV_FS451 614 if (gfx_tv_type & GFX_TV_TYPE_FS451) 615 retval = fs450_set_tv_standard(standard); 616#endif 617 return (retval); 618} 619 620/* 621// ========================================================================== 622// 623// vga mode as known by the driver 624*/ 625 626int 627gfx_get_tv_vga_mode(unsigned long *p_vga_mode) 628{ 629 int retval = -1; 630 631#if GFX_TV_FS451 632 if (gfx_tv_type & GFX_TV_TYPE_FS451) 633 retval = fs450_get_tv_vga_mode(p_vga_mode); 634#endif 635 return (retval); 636} 637 638int 639gfx_get_available_tv_vga_modes(unsigned long *p_vga_modes) 640{ 641 int retval = -1; 642 643#if GFX_TV_FS451 644 if (gfx_tv_type & GFX_TV_TYPE_FS451) 645 retval = fs450_get_available_tv_vga_modes(p_vga_modes); 646#endif 647 return (retval); 648} 649 650int 651gfx_set_tv_vga_mode(unsigned long vga_mode) 652{ 653 int retval = -1; 654 655#if GFX_TV_FS451 656 if (gfx_tv_type & GFX_TV_TYPE_FS451) 657 retval = fs450_set_tv_vga_mode(vga_mode); 658#endif 659 return (retval); 660} 661 662/* 663// ========================================================================== 664// 665// tvout mode 666*/ 667 668int 669gfx_get_tvout_mode(unsigned long *p_tvout_mode) 670{ 671 int retval = -1; 672 673#if GFX_TV_FS451 674 if (gfx_tv_type & GFX_TV_TYPE_FS451) 675 retval = fs450_get_tvout_mode(p_tvout_mode); 676#endif 677 return (retval); 678} 679 680int 681gfx_set_tvout_mode(unsigned long tvout_mode) 682{ 683 int retval = -1; 684 685#if GFX_TV_FS451 686 if (gfx_tv_type & GFX_TV_TYPE_FS451) 687 retval = fs450_set_tvout_mode(tvout_mode); 688#endif 689 return (retval); 690} 691 692/* 693// ========================================================================== 694// 695// Sharpness 696*/ 697int 698gfx_get_sharpness(int *p_sharpness) 699{ 700 int retval = -1; 701 702#if GFX_TV_FS451 703 if (gfx_tv_type & GFX_TV_TYPE_FS451) 704 retval = fs450_get_sharpness(p_sharpness); 705#endif 706 return (retval); 707} 708 709int 710gfx_set_sharpness(int sharpness) 711{ 712 int retval = -1; 713 714#if GFX_TV_FS451 715 if (gfx_tv_type & GFX_TV_TYPE_FS451) 716 retval = fs450_set_sharpness(sharpness); 717#endif 718 return (retval); 719} 720 721/* 722// ========================================================================== 723// 724// flicker filter control. 725*/ 726 727int 728gfx_get_flicker_filter(int *p_flicker) 729{ 730 int retval = -1; 731 732#if GFX_TV_FS451 733 if (gfx_tv_type & GFX_TV_TYPE_FS451) 734 retval = fs450_get_flicker_filter(p_flicker); 735#endif 736 return (retval); 737} 738 739int 740gfx_set_flicker_filter(int flicker) 741{ 742 int retval = -1; 743 744#if GFX_TV_FS451 745 if (gfx_tv_type & GFX_TV_TYPE_FS451) 746 retval = fs450_set_flicker_filter(flicker); 747#endif 748 return (retval); 749} 750 751/* 752// ========================================================================== 753// 754// Overscan and Position 755*/ 756 757int 758gfx_get_overscan(int *p_x, int *p_y) 759{ 760 int retval = -1; 761 762#if GFX_TV_FS451 763 if (gfx_tv_type & GFX_TV_TYPE_FS451) 764 retval = fs450_get_overscan(p_x, p_y); 765#endif 766 return (retval); 767 768} 769 770int 771gfx_set_overscan(int x, int y) 772{ 773 int retval = -1; 774 775#if GFX_TV_FS451 776 if (gfx_tv_type & GFX_TV_TYPE_FS451) 777 retval = fs450_set_overscan(x, y); 778#endif 779 return (retval); 780} 781 782int 783gfx_get_position(int *p_x, int *p_y) 784{ 785 int retval = -1; 786 787#if GFX_TV_FS451 788 if (gfx_tv_type & GFX_TV_TYPE_FS451) 789 retval = fs450_get_position(p_x, p_y); 790#endif 791 return (retval); 792} 793 794int 795gfx_set_position(int x, int y) 796{ 797 int retval = -1; 798 799#if GFX_TV_FS451 800 if (gfx_tv_type & GFX_TV_TYPE_FS451) 801 retval = fs450_set_position(x, y); 802#endif 803 return (retval); 804} 805 806/* 807// ========================================================================== 808// 809// Color, Brightness, and Contrast 810*/ 811 812int 813gfx_get_color(int *p_color) 814{ 815 int retval = -1; 816 817#if GFX_TV_FS451 818 if (gfx_tv_type & GFX_TV_TYPE_FS451) 819 retval = fs450_get_color(p_color); 820#endif 821 return (retval); 822} 823 824int 825gfx_set_color(int color) 826{ 827 int retval = -1; 828 829#if GFX_TV_FS451 830 if (gfx_tv_type & GFX_TV_TYPE_FS451) 831 retval = fs450_set_color(color); 832#endif 833 return (retval); 834} 835 836int 837gfx_get_brightness(int *p_brightness) 838{ 839 int retval = -1; 840 841#if GFX_TV_FS451 842 if (gfx_tv_type & GFX_TV_TYPE_FS451) 843 retval = fs450_get_brightness(p_brightness); 844#endif 845 return (retval); 846} 847 848int 849gfx_set_brightness(int brightness) 850{ 851 int retval = -1; 852 853#if GFX_TV_FS451 854 if (gfx_tv_type & GFX_TV_TYPE_FS451) 855 retval = fs450_set_brightness(brightness); 856#endif 857 return (retval); 858} 859 860int 861gfx_get_contrast(int *p_contrast) 862{ 863 int retval = -1; 864 865#if GFX_TV_FS451 866 if (gfx_tv_type & GFX_TV_TYPE_FS451) 867 retval = fs450_get_contrast(p_contrast); 868#endif 869 return (retval); 870} 871 872int 873gfx_set_contrast(int contrast) 874{ 875 int retval = -1; 876 877#if GFX_TV_FS451 878 if (gfx_tv_type & GFX_TV_TYPE_FS451) 879 retval = fs450_set_contrast(contrast); 880#endif 881 return (retval); 882} 883 884/* 885// ========================================================================== 886// 887// YC filters 888*/ 889 890int 891gfx_get_yc_filter(unsigned int *p_yc_filter) 892{ 893 int retval = -1; 894 895#if GFX_TV_FS451 896 if (gfx_tv_type & GFX_TV_TYPE_FS451) 897 retval = fs450_get_yc_filter(p_yc_filter); 898#endif 899 return (retval); 900} 901 902int 903gfx_set_yc_filter(unsigned int yc_filter) 904{ 905 int retval = -1; 906 907#if GFX_TV_FS451 908 if (gfx_tv_type & GFX_TV_TYPE_FS451) 909 retval = fs450_set_yc_filter(yc_filter); 910#endif 911 return (retval); 912} 913 914int 915gfx_get_aps_trigger_bits(unsigned int *p_trigger_bits) 916{ 917 int retval = -1; 918 919#if GFX_TV_FS451 920 if (gfx_tv_type & GFX_TV_TYPE_FS451) 921 retval = fs450_get_aps_trigger_bits(p_trigger_bits); 922#endif 923 return (retval); 924} 925 926int 927gfx_set_aps_trigger_bits(unsigned int trigger_bits) 928{ 929 int retval = -1; 930 931#if GFX_TV_FS451 932 if (gfx_tv_type & GFX_TV_TYPE_FS451) 933 retval = fs450_set_aps_trigger_bits(trigger_bits); 934#endif 935 return (retval); 936} 937 938#endif /* GFX_TV_DYNAMIC */ 939 940/* END OF FILE */ 941