1f29dbc25Smrg/* Copyright (c) 2005 Advanced Micro Devices, Inc. 2f29dbc25Smrg * 3f29dbc25Smrg * Permission is hereby granted, free of charge, to any person obtaining a copy 4f29dbc25Smrg * of this software and associated documentation files (the "Software"), to 5f29dbc25Smrg * deal in the Software without restriction, including without limitation the 6f29dbc25Smrg * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 7f29dbc25Smrg * sell copies of the Software, and to permit persons to whom the Software is 8f29dbc25Smrg * furnished to do so, subject to the following conditions: 9f29dbc25Smrg * 10f29dbc25Smrg * The above copyright notice and this permission notice shall be included in 11f29dbc25Smrg * all copies or substantial portions of the Software. 12f29dbc25Smrg * 13f29dbc25Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14f29dbc25Smrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15f29dbc25Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16f29dbc25Smrg * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17f29dbc25Smrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 18f29dbc25Smrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19f29dbc25Smrg * IN THE SOFTWARE. 20f29dbc25Smrg * 21f29dbc25Smrg * Neither the name of the Advanced Micro Devices, Inc. nor the names of its 22f29dbc25Smrg * contributors may be used to endorse or promote products derived from this 23f29dbc25Smrg * software without specific prior written permission. 24f29dbc25Smrg * */ 25f29dbc25Smrg 26f29dbc25Smrg/* 27f29dbc25Smrg * This file contains routines to program TVOUT and TV encoder. 28f29dbc25Smrg * 29f29dbc25Smrg * Routines: 30f29dbc25Smrg * 31f29dbc25Smrg * gfx_set_tv_format 32f29dbc25Smrg * gfx_set_tv_output 33f29dbc25Smrg * gfx_set_tv_enable 34f29dbc25Smrg * gfx_set_tv_flicker_filter 35f29dbc25Smrg * gfx_set_tv_sub_carrier_reset 36f29dbc25Smrg * gfx_set_tv_vphase 37f29dbc25Smrg * gfx_set_tv_YC_delay 38f29dbc25Smrg * gfx_set_tvenc_reset_interval 39f29dbc25Smrg * gfx_set_tv_cc_enable 40f29dbc25Smrg * gfx_set_tv_cc_data 41f29dbc25Smrg * gfx_test_tvout_odd_field 42f29dbc25Smrg * gfx_test_tvenc_odd_field 43f29dbc25Smrg * gfx_set_tv_field_status_invert 44f29dbc25Smrg * gfx_get_tv_vphase 45f29dbc25Smrg * */ 46f29dbc25Smrg 47f29dbc25Smrg/* TV TIMINGS */ 48f29dbc25Smrg 49f29dbc25SmrgDISPLAYMODE TVTimings[] = { 50f29dbc25Smrg 51f29dbc25Smrg/* NTSC resolution */ 52f29dbc25Smrg 5304007ebaSmrg {0x3 | /* negative syncs */ 5404007ebaSmrg GFX_MODE_TV_NTSC, /* NTSC format */ 5504007ebaSmrg 640, 640, 656, 744, 792, 792, /* horizontal timings */ 5604007ebaSmrg 480, 480, 490, 492, 517, 525, /* vertical timings */ 5704007ebaSmrg 0x0018EC4D, /* freq = 24.923052 MHz */ 5804007ebaSmrg } 59f29dbc25Smrg , 60f29dbc25Smrg 61f29dbc25Smrg/* PAL resolution */ 62f29dbc25Smrg 6304007ebaSmrg {0x3 | /* negative syncs */ 6404007ebaSmrg GFX_MODE_TV_PAL, /* PAL format */ 6504007ebaSmrg 768, 768, 800, 848, 864, 864, /* horizontal timings */ 6604007ebaSmrg 576, 576, 586, 588, 625, 625, /* vertical timings */ 6704007ebaSmrg 0x001B0000, /* freq = 27.00 MHz */ 6804007ebaSmrg } 69f29dbc25Smrg , 70f29dbc25Smrg 71f29dbc25Smrg/* NTSC resolution non-square pixels */ 72f29dbc25Smrg 7304007ebaSmrg {0x3 | /* negative syncs */ 7404007ebaSmrg GFX_MODE_TV_NTSC, /* NTSC format */ 7504007ebaSmrg 720, 720, 736, 752, 792, 792, /* horizontal timings */ 7604007ebaSmrg 480, 480, 490, 492, 517, 525, /* vertical timings */ 7704007ebaSmrg 0x0018EC4D, /* freq = 24.923052 MHz */ 7804007ebaSmrg } 79f29dbc25Smrg , 80f29dbc25Smrg 81f29dbc25Smrg/* PAL resolution non-square pixels */ 82f29dbc25Smrg 8304007ebaSmrg {0x3 | /* negative syncs */ 8404007ebaSmrg GFX_MODE_TV_PAL, /* PAL format */ 8504007ebaSmrg 720, 720, 752, 816, 864, 864, /* horizontal timings */ 8604007ebaSmrg 576, 576, 586, 588, 625, 625, /* vertical timings */ 8704007ebaSmrg 0x001B0000, /* freq = 27.00 MHz */ 8804007ebaSmrg } 89f29dbc25Smrg}; 90f29dbc25Smrg 91f29dbc25Smrg#define NUM_TV_MODES sizeof(TVTimings)/sizeof(DISPLAYMODE) 92f29dbc25Smrg 93f29dbc25Smrg/* INCLUDE SUPPORT FOR SC1200 TV ENCODER, IF SPECIFIED */ 94f29dbc25Smrg 95f29dbc25Smrg#if GFX_TV_SC1200 96f29dbc25Smrg#include "tv_1200.c" 97f29dbc25Smrg#endif 98f29dbc25Smrg 99f29dbc25Smrg/* INCLUDE SUPPORT FOR FS450 TV ENCODER, IF SPECIFIED */ 100f29dbc25Smrg 101f29dbc25Smrg#if GFX_TV_FS451 102f29dbc25Smrg#include "tv_fs450.c" 103f29dbc25Smrg#endif 104f29dbc25Smrg 105f29dbc25Smrg/* WRAPPERS IF DYNAMIC SELECTION */ 106f29dbc25Smrg/* Extra layer to call either SC1200 or FS450 TV encoder routines. */ 107f29dbc25Smrg 108f29dbc25Smrg#if GFX_TV_DYNAMIC 109f29dbc25Smrg 110f29dbc25Smrg/*---------------------------------------------------------------------------- 111f29dbc25Smrg * gfx_set_tv_format 112f29dbc25Smrg *---------------------------------------------------------------------------- 113f29dbc25Smrg */ 114f29dbc25Smrgint 115f29dbc25Smrggfx_set_tv_format(TVStandardType format, GfxOnTVType resolution) 116f29dbc25Smrg{ 117f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 118f29dbc25Smrg 119f29dbc25Smrg#if GFX_TV_SC1200 120f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 121f29dbc25Smrg retval = sc1200_set_tv_format(format, resolution); 122f29dbc25Smrg#endif 123f29dbc25Smrg#if GFX_TV_FS451 124f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 125f29dbc25Smrg retval = fs450_set_tv_format(format, resolution); 126f29dbc25Smrg#endif 127f29dbc25Smrg return (retval); 128f29dbc25Smrg} 129f29dbc25Smrg 130f29dbc25Smrg/*---------------------------------------------------------------------------- 131f29dbc25Smrg * gfx_set_tv_output 132f29dbc25Smrg *---------------------------------------------------------------------------- 133f29dbc25Smrg */ 134f29dbc25Smrgint 135f29dbc25Smrggfx_set_tv_output(int output) 136f29dbc25Smrg{ 137f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 138f29dbc25Smrg 139f29dbc25Smrg#if GFX_TV_SC1200 140f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 141f29dbc25Smrg retval = sc1200_set_tv_output(output); 142f29dbc25Smrg#endif 143f29dbc25Smrg#if GFX_TV_FS451 144f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 145f29dbc25Smrg retval = fs450_set_tv_output(output); 146f29dbc25Smrg#endif 147f29dbc25Smrg return (retval); 148f29dbc25Smrg} 149f29dbc25Smrg 150f29dbc25Smrg/*---------------------------------------------------------------------------- 151f29dbc25Smrg * gfx_set_tv_enable 152f29dbc25Smrg *---------------------------------------------------------------------------- 153f29dbc25Smrg */ 154f29dbc25Smrgint 155f29dbc25Smrggfx_set_tv_enable(int enable) 156f29dbc25Smrg{ 157f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 158f29dbc25Smrg 159f29dbc25Smrg#if GFX_TV_SC1200 160f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 161f29dbc25Smrg retval = sc1200_set_tv_enable(enable); 162f29dbc25Smrg#endif 163f29dbc25Smrg#if GFX_TV_FS451 164f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 165f29dbc25Smrg retval = fs450_set_tv_enable(enable); 166f29dbc25Smrg#endif 167f29dbc25Smrg return (retval); 168f29dbc25Smrg} 169f29dbc25Smrg 170f29dbc25Smrg/*---------------------------------------------------------------------------- 171f29dbc25Smrg * gfx_set_tv_flicker_filter 172f29dbc25Smrg *---------------------------------------------------------------------------- 173f29dbc25Smrg */ 174f29dbc25Smrgint 175f29dbc25Smrggfx_set_tv_flicker_filter(int ff) 176f29dbc25Smrg{ 177f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 178f29dbc25Smrg 179f29dbc25Smrg#if GFX_TV_SC1200 180f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 181f29dbc25Smrg retval = sc1200_set_tv_flicker_filter(ff); 182f29dbc25Smrg#endif 183f29dbc25Smrg return (retval); 184f29dbc25Smrg} 185f29dbc25Smrg 186f29dbc25Smrg/*---------------------------------------------------------------------------- 187f29dbc25Smrg * gfx_set_tv_sub_carrier_reset 188f29dbc25Smrg *---------------------------------------------------------------------------- 189f29dbc25Smrg */ 190f29dbc25Smrgint 191f29dbc25Smrggfx_set_tv_sub_carrier_reset(int screset) 192f29dbc25Smrg{ 193f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 194f29dbc25Smrg 195f29dbc25Smrg#if GFX_TV_SC1200 196f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 197f29dbc25Smrg retval = sc1200_set_tv_sub_carrier_reset(screset); 198f29dbc25Smrg#endif 199f29dbc25Smrg return (retval); 200f29dbc25Smrg} 201f29dbc25Smrg 202f29dbc25Smrg/*---------------------------------------------------------------------------- 203f29dbc25Smrg * gfx_set_tv_vphase 204f29dbc25Smrg *---------------------------------------------------------------------------- 205f29dbc25Smrg */ 206f29dbc25Smrgint 207f29dbc25Smrggfx_set_tv_vphase(int vphase) 208f29dbc25Smrg{ 209f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 210f29dbc25Smrg 211f29dbc25Smrg#if GFX_TV_SC1200 212f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 213f29dbc25Smrg retval = sc1200_set_tv_vphase(vphase); 214f29dbc25Smrg#endif 215f29dbc25Smrg return (retval); 216f29dbc25Smrg} 217f29dbc25Smrg 218f29dbc25Smrg/*---------------------------------------------------------------------------- 219f29dbc25Smrg * gfx_set_tv_YC_delay 220f29dbc25Smrg *---------------------------------------------------------------------------- 221f29dbc25Smrg */ 222f29dbc25Smrgint 223f29dbc25Smrggfx_set_tv_YC_delay(int delay) 224f29dbc25Smrg{ 225f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 226f29dbc25Smrg 227f29dbc25Smrg#if GFX_TV_SC1200 228f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 229f29dbc25Smrg retval = sc1200_set_tv_YC_delay(delay); 230f29dbc25Smrg#endif 231f29dbc25Smrg return (retval); 232f29dbc25Smrg} 233f29dbc25Smrg 234f29dbc25Smrg/*---------------------------------------------------------------------------- 235f29dbc25Smrg * gfx_set_tvenc_reset_interval 236f29dbc25Smrg *---------------------------------------------------------------------------- 237f29dbc25Smrg */ 238f29dbc25Smrgint 239f29dbc25Smrggfx_set_tvenc_reset_interval(int interval) 240f29dbc25Smrg{ 241f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 242f29dbc25Smrg 243f29dbc25Smrg#if GFX_TV_SC1200 244f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 245f29dbc25Smrg retval = sc1200_set_tvenc_reset_interval(interval); 246f29dbc25Smrg#endif 247f29dbc25Smrg return (retval); 248f29dbc25Smrg} 249f29dbc25Smrg 250f29dbc25Smrg/*---------------------------------------------------------------------------- 251f29dbc25Smrg * gfx_set_tv_cc_enable 252f29dbc25Smrg *---------------------------------------------------------------------------- 253f29dbc25Smrg */ 254f29dbc25Smrgint 255f29dbc25Smrggfx_set_tv_cc_enable(int enable) 256f29dbc25Smrg{ 257f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 258f29dbc25Smrg 259f29dbc25Smrg#if GFX_TV_SC1200 260f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 261f29dbc25Smrg retval = sc1200_set_tv_cc_enable(enable); 262f29dbc25Smrg#endif 263f29dbc25Smrg return (retval); 264f29dbc25Smrg} 265f29dbc25Smrg 266f29dbc25Smrg/*---------------------------------------------------------------------------- 267f29dbc25Smrg * gfx_set_tv_cc_data 268f29dbc25Smrg * 269f29dbc25Smrg * This routine writes the two specified characters to the CC data register 270f29dbc25Smrg * of the TV encoder. 271f29dbc25Smrg *---------------------------------------------------------------------------- 272f29dbc25Smrg */ 273f29dbc25Smrgint 274f29dbc25Smrggfx_set_tv_cc_data(unsigned char data1, unsigned char data2) 275f29dbc25Smrg{ 276f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 277f29dbc25Smrg 278f29dbc25Smrg#if GFX_TV_SC1200 279f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 280f29dbc25Smrg retval = sc1200_set_tv_cc_data(data1, data2); 281f29dbc25Smrg#endif 282f29dbc25Smrg return (retval); 283f29dbc25Smrg} 284f29dbc25Smrg 285f29dbc25Smrg/*--------------------------------------------------------------------------- 286f29dbc25Smrg * gfx_set_tv_display 287f29dbc25Smrg * 288f29dbc25Smrg * Set the timings in the display controller to support a TV resolution. 289f29dbc25Smrg *--------------------------------------------------------------------------- 290f29dbc25Smrg */ 291f29dbc25Smrgint 292f29dbc25Smrggfx_set_tv_display(int width, int height) 293f29dbc25Smrg{ 294f29dbc25Smrg int status = GFX_STATUS_UNSUPPORTED; 295f29dbc25Smrg 296f29dbc25Smrg#if GFX_TV_SC1200 297f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 298f29dbc25Smrg status = sc1200_set_tv_display(width, height); 299f29dbc25Smrg#endif 300f29dbc25Smrg return (status); 301f29dbc25Smrg} 302f29dbc25Smrg 303f29dbc25Smrg/*--------------------------------------------------------------------------- 304f29dbc25Smrg * gfx_test_tvout_odd_field 305f29dbc25Smrg *--------------------------------------------------------------------------- 306f29dbc25Smrg */ 307f29dbc25Smrgint 308f29dbc25Smrggfx_test_tvout_odd_field(void) 309f29dbc25Smrg{ 310f29dbc25Smrg int status = GFX_STATUS_UNSUPPORTED; 311f29dbc25Smrg 312f29dbc25Smrg#if GFX_TV_SC1200 313f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 314f29dbc25Smrg status = sc1200_test_tvout_odd_field(); 315f29dbc25Smrg#endif 316f29dbc25Smrg return (status); 317f29dbc25Smrg} 318f29dbc25Smrg 319f29dbc25Smrg/*--------------------------------------------------------------------------- 320f29dbc25Smrg * gfx_test_tvenc_odd_field 321f29dbc25Smrg *--------------------------------------------------------------------------- 322f29dbc25Smrg */ 323f29dbc25Smrgint 324f29dbc25Smrggfx_test_tvenc_odd_field(void) 325f29dbc25Smrg{ 326f29dbc25Smrg int status = GFX_STATUS_UNSUPPORTED; 327f29dbc25Smrg 328f29dbc25Smrg#if GFX_TV_SC1200 329f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 330f29dbc25Smrg status = sc1200_test_tvenc_odd_field(); 331f29dbc25Smrg#endif 332f29dbc25Smrg return (status); 333f29dbc25Smrg} 334f29dbc25Smrg 335f29dbc25Smrg/*---------------------------------------------------------------------------- 336f29dbc25Smrg * gfx_set_tv_field_status_invert 337f29dbc25Smrg *---------------------------------------------------------------------------- 338f29dbc25Smrg */ 339f29dbc25Smrgint 340f29dbc25Smrggfx_set_tv_field_status_invert(int enable) 341f29dbc25Smrg{ 342f29dbc25Smrg int retval = GFX_STATUS_UNSUPPORTED; 343f29dbc25Smrg 344f29dbc25Smrg#if GFX_TV_SC1200 345f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 346f29dbc25Smrg retval = sc1200_set_tv_field_status_invert(enable); 347f29dbc25Smrg#endif 348f29dbc25Smrg return (retval); 349f29dbc25Smrg} 350f29dbc25Smrg 351f29dbc25Smrg/*--------------------------------------------------------------------------- 352f29dbc25Smrg * gfx_get_tv_vphase 353f29dbc25Smrg *--------------------------------------------------------------------------- 354f29dbc25Smrg */ 355f29dbc25Smrgint 356f29dbc25Smrggfx_get_tv_vphase(void) 357f29dbc25Smrg{ 358f29dbc25Smrg int status = GFX_STATUS_UNSUPPORTED; 359f29dbc25Smrg 360f29dbc25Smrg#if GFX_TV_SC1200 361f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 362f29dbc25Smrg status = sc1200_get_tv_vphase(); 363f29dbc25Smrg#endif 364f29dbc25Smrg return (status); 365f29dbc25Smrg} 366f29dbc25Smrg 367f29dbc25Smrg/*--------------------------------------------------------------------------- 368f29dbc25Smrg * gfx_get_tv_enable 369f29dbc25Smrg *--------------------------------------------------------------------------- 370f29dbc25Smrg */ 371f29dbc25Smrgint 372f29dbc25Smrggfx_get_tv_enable(unsigned int *p_on) 373f29dbc25Smrg{ 374f29dbc25Smrg int retval = -1; 375f29dbc25Smrg 376f29dbc25Smrg#if GFX_TV_FS451 377f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 378f29dbc25Smrg retval = fs450_get_tv_enable(p_on); 379f29dbc25Smrg#endif 380f29dbc25Smrg#if GFX_TV_SC1200 381f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 382f29dbc25Smrg retval = sc1200_get_tv_enable(p_on); 383f29dbc25Smrg#endif 384f29dbc25Smrg return (retval); 385f29dbc25Smrg} 386f29dbc25Smrg 387f29dbc25Smrg/*--------------------------------------------------------------------------- 388f29dbc25Smrg * gfx_get_tv_output 389f29dbc25Smrg *--------------------------------------------------------------------------- 390f29dbc25Smrg */ 391f29dbc25Smrgint 392f29dbc25Smrggfx_get_tv_output() 393f29dbc25Smrg{ 394f29dbc25Smrg int retval = -1; 395f29dbc25Smrg 396f29dbc25Smrg#if GFX_TV_SC1200 397f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 398f29dbc25Smrg retval = sc1200_get_tv_output(); 399f29dbc25Smrg#endif 400f29dbc25Smrg return (retval); 401f29dbc25Smrg} 402f29dbc25Smrg 403f29dbc25Smrg/*--------------------------------------------------------------------------- 404f29dbc25Smrg * gfx_get_tv_mode_count 405f29dbc25Smrg *--------------------------------------------------------------------------- 406f29dbc25Smrg */ 407f29dbc25Smrgint 408f29dbc25Smrggfx_get_tv_mode_count(TVStandardType format) 409f29dbc25Smrg{ 410f29dbc25Smrg int retval = -1; 411f29dbc25Smrg 412f29dbc25Smrg#if GFX_TV_SC1200 413f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 414f29dbc25Smrg retval = sc1200_get_tv_mode_count(format); 415f29dbc25Smrg#endif 416f29dbc25Smrg return (retval); 417f29dbc25Smrg} 418f29dbc25Smrg 419f29dbc25Smrg/*--------------------------------------------------------------------------- 420f29dbc25Smrg * gfx_get_tv_display_mode 421f29dbc25Smrg *--------------------------------------------------------------------------- 422f29dbc25Smrg */ 423f29dbc25Smrgint 424f29dbc25Smrggfx_get_tv_display_mode(int *width, int *height, int *bpp, int *hz) 425f29dbc25Smrg{ 426f29dbc25Smrg int retval = -1; 427f29dbc25Smrg 428f29dbc25Smrg#if GFX_TV_SC1200 429f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 430f29dbc25Smrg retval = sc1200_get_tv_display_mode(width, height, bpp, hz); 431f29dbc25Smrg#endif 432f29dbc25Smrg return (retval); 433f29dbc25Smrg} 434f29dbc25Smrg 435f29dbc25Smrg/*--------------------------------------------------------------------------- 436f29dbc25Smrg * gfx_get_tv_display_mode_frequency 437f29dbc25Smrg *--------------------------------------------------------------------------- 438f29dbc25Smrg */ 439f29dbc25Smrgint 440f29dbc25Smrggfx_get_tv_display_mode_frequency(unsigned short width, unsigned short height, 44104007ebaSmrg TVStandardType format, int *frequency) 442f29dbc25Smrg{ 443f29dbc25Smrg int retval = -1; 444f29dbc25Smrg 445f29dbc25Smrg#if GFX_TV_SC1200 446f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 447f29dbc25Smrg retval = 448f29dbc25Smrg sc1200_get_tv_display_mode_frequency(width, height, format, 44904007ebaSmrg frequency); 450f29dbc25Smrg#endif 451f29dbc25Smrg return (retval); 452f29dbc25Smrg} 453f29dbc25Smrg 454f29dbc25Smrg/*--------------------------------------------------------------------------- 455f29dbc25Smrg * gfx_is_tv_display_mode_supported 456f29dbc25Smrg *--------------------------------------------------------------------------- 457f29dbc25Smrg */ 458f29dbc25Smrgint 459f29dbc25Smrggfx_is_tv_display_mode_supported(unsigned short width, unsigned short height, 46004007ebaSmrg TVStandardType format) 461f29dbc25Smrg{ 462f29dbc25Smrg int retval = -1; 463f29dbc25Smrg 464f29dbc25Smrg#if GFX_TV_SC1200 465f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_SC1200) 466f29dbc25Smrg retval = sc1200_is_tv_display_mode_supported(width, height, format); 467f29dbc25Smrg#endif 468f29dbc25Smrg return (retval); 469f29dbc25Smrg} 470f29dbc25Smrg 471f29dbc25Smrg/*------------------------------------------ 472f29dbc25Smrg * The following functions were added to support 473f29dbc25Smrg * the FS450 and will eventually be removed. There 474f29dbc25Smrg * is no equivalent support in the SC1200. 475f29dbc25Smrg *----------------------------------------------*/ 476f29dbc25Smrg 477f29dbc25Smrg/*========================================================================== 478f29dbc25Smrg * TV standard 479f29dbc25Smrg *========================================================================== 480f29dbc25Smrg */ 481f29dbc25Smrgint 482f29dbc25Smrggfx_get_tv_standard(unsigned long *p_standard) 483f29dbc25Smrg{ 484f29dbc25Smrg int retval = -1; 485f29dbc25Smrg 486f29dbc25Smrg#if GFX_TV_FS451 487f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 488f29dbc25Smrg retval = fs450_get_tv_standard(p_standard); 489f29dbc25Smrg#endif 490f29dbc25Smrg return (retval); 491f29dbc25Smrg} 492f29dbc25Smrg 493f29dbc25Smrgint 494f29dbc25Smrggfx_get_available_tv_standards(unsigned long *p_standards) 495f29dbc25Smrg{ 496f29dbc25Smrg int retval = -1; 497f29dbc25Smrg 498f29dbc25Smrg#if GFX_TV_FS451 499f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 500f29dbc25Smrg retval = fs450_get_available_tv_standards(p_standards); 501f29dbc25Smrg#endif 502f29dbc25Smrg return (retval); 503f29dbc25Smrg} 504f29dbc25Smrg 505f29dbc25Smrgint 506f29dbc25Smrggfx_set_tv_standard(unsigned long standard) 507f29dbc25Smrg{ 508f29dbc25Smrg int retval = -1; 509f29dbc25Smrg 510f29dbc25Smrg#if GFX_TV_FS451 511f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 512f29dbc25Smrg retval = fs450_set_tv_standard(standard); 513f29dbc25Smrg#endif 514f29dbc25Smrg return (retval); 515f29dbc25Smrg} 516f29dbc25Smrg 517f29dbc25Smrg/* 518f29dbc25Smrg *========================================================================== 519f29dbc25Smrg * vga mode as known by the driver 520f29dbc25Smrg *========================================================================== 521f29dbc25Smrg */ 522f29dbc25Smrgint 523f29dbc25Smrggfx_get_tv_vga_mode(unsigned long *p_vga_mode) 524f29dbc25Smrg{ 525f29dbc25Smrg int retval = -1; 526f29dbc25Smrg 527f29dbc25Smrg#if GFX_TV_FS451 528f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 529f29dbc25Smrg retval = fs450_get_tv_vga_mode(p_vga_mode); 530f29dbc25Smrg#endif 531f29dbc25Smrg return (retval); 532f29dbc25Smrg} 533f29dbc25Smrg 534f29dbc25Smrgint 535f29dbc25Smrggfx_get_available_tv_vga_modes(unsigned long *p_vga_modes) 536f29dbc25Smrg{ 537f29dbc25Smrg int retval = -1; 538f29dbc25Smrg 539f29dbc25Smrg#if GFX_TV_FS451 540f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 541f29dbc25Smrg retval = fs450_get_available_tv_vga_modes(p_vga_modes); 542f29dbc25Smrg#endif 543f29dbc25Smrg return (retval); 544f29dbc25Smrg} 545f29dbc25Smrg 546f29dbc25Smrgint 547f29dbc25Smrggfx_set_tv_vga_mode(unsigned long vga_mode) 548f29dbc25Smrg{ 549f29dbc25Smrg int re tval = -1; 550f29dbc25Smrg 551f29dbc25Smrg#if GFX_TV_FS451 552f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 553f29dbc25Smrg retval = fs450_set_tv_vga_mode(vga_mode); 554f29dbc25Smrg#endif 555f29dbc25Smrg return (retval); 556f29dbc25Smrg} 557f29dbc25Smrg 558f29dbc25Smrg/* 559f29dbc25Smrg *========================================================================== 560f29dbc25Smrg * 561f29dbc25Smrg * tvout mode 562f29dbc25Smrg */ 563f29dbc25Smrg 564f29dbc25Smrgint 565f29dbc25Smrggfx_get_tvout_mode(unsigned long *p_tvout_mode) 566f29dbc25Smrg{ 567f29dbc25Smrg int retval = -1; 568f29dbc25Smrg 569f29dbc25Smrg#if GFX_TV_FS451 570f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 571f29dbc25Smrg retval = fs450_get_tvout_mode(p_tvout_mode); 572f29dbc25Smrg#endif 573f29dbc25Smrg return (retval); 574f29dbc25Smrg} 575f29dbc25Smrg 576f29dbc25Smrgint 577f29dbc25Smrggfx_set_tvout_mode(unsigned long tvout_mode) 578f29dbc25Smrg{ 579f29dbc25Smrg int retval = -1; 580f29dbc25Smrg 581f29dbc25Smrg#if GFX_TV_FS451 582f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 583f29dbc25Smrg retval = fs450_set_tvout_mode(tvout_mode); 584f29dbc25Smrg#endif 585f29dbc25Smrg return (retval); 586f29dbc25Smrg} 587f29dbc25Smrg 588f29dbc25Smrg/* 589f29dbc25Smrg *========================================================================== 590f29dbc25Smrg * 591f29dbc25Smrg * Sharpness 592f29dbc25Smrg */ 593f29dbc25Smrgint 594f29dbc25Smrggfx_get_sharpness(int *p_sharpness) 595f29dbc25Smrg{ 596f29dbc25Smrg int retval = -1; 597f29dbc25Smrg 598f29dbc25Smrg#if GFX_TV_FS451 599f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 600f29dbc25Smrg retval = fs450_get_sharpness(p_sharpness); 601f29dbc25Smrg#endif 602f29dbc25Smrg return (retval); 603f29dbc25Smrg} 604f29dbc25Smrg 605f29dbc25Smrgint 606f29dbc25Smrggfx_set_sharpness(int sharpness) 607f29dbc25Smrg{ 608f29dbc25Smrg int retval = -1; 609f29dbc25Smrg 610f29dbc25Smrg#if GFX_TV_FS451 611f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 612f29dbc25Smrg retval = fs450_set_sharpness(sharpness); 613f29dbc25Smrg#endif 614f29dbc25Smrg return (retval); 615f29dbc25Smrg} 616f29dbc25Smrg 617f29dbc25Smrg/* 618f29dbc25Smrg *========================================================================== 619f29dbc25Smrg * 620f29dbc25Smrg * flicker filter control. 621f29dbc25Smrg */ 622f29dbc25Smrg 623f29dbc25Smrgint 624f29dbc25Smrggfx_get_flicker_filter(int *p_flicker) 625f29dbc25Smrg{ 626f29dbc25Smrg int retval = -1; 627f29dbc25Smrg 628f29dbc25Smrg#if GFX_TV_FS451 629f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 630f29dbc25Smrg retval = fs450_get_flicker_filter(p_flicker); 631f29dbc25Smrg#endif 632f29dbc25Smrg return (retval); 633f29dbc25Smrg} 634f29dbc25Smrg 635f29dbc25Smrgint 636f29dbc25Smrggfx_set_flicker_filter(int flicker) 637f29dbc25Smrg{ 638f29dbc25Smrg int retval = -1; 639f29dbc25Smrg 640f29dbc25Smrg#if GFX_TV_FS451 641f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 642f29dbc25Smrg retval = fs450_set_flicker_filter(flicker); 643f29dbc25Smrg#endif 644f29dbc25Smrg return (retval); 645f29dbc25Smrg} 646f29dbc25Smrg 647f29dbc25Smrg/* 648f29dbc25Smrg *========================================================================== 649f29dbc25Smrg * 650f29dbc25Smrg * Overscan and Position 651f29dbc25Smrg */ 652f29dbc25Smrg 653f29dbc25Smrgint 654f29dbc25Smrggfx_get_overscan(int *p_x, int *p_y) 655f29dbc25Smrg{ 656f29dbc25Smrg int retval = -1; 657f29dbc25Smrg 658f29dbc25Smrg#if GFX_TV_FS451 659f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 660f29dbc25Smrg retval = fs450_get_overscan(p_x, p_y); 661f29dbc25Smrg#endif 662f29dbc25Smrg return (retval); 663f29dbc25Smrg 664f29dbc25Smrg} 665f29dbc25Smrg 666f29dbc25Smrgint 667f29dbc25Smrggfx_set_overscan(int x, int y) 668f29dbc25Smrg{ 669f29dbc25Smrg int retval = -1; 670f29dbc25Smrg 671f29dbc25Smrg#if GFX_TV_FS451 672f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 673f29dbc25Smrg retval = fs450_set_overscan(x, y); 674f29dbc25Smrg#endif 675f29dbc25Smrg return (retval); 676f29dbc25Smrg} 677f29dbc25Smrg 678f29dbc25Smrgint 679f29dbc25Smrggfx_get_position(int *p_x, int *p_y) 680f29dbc25Smrg{ 681f29dbc25Smrg int retval = -1; 682f29dbc25Smrg 683f29dbc25Smrg#if GFX_TV_FS451 684f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 685f29dbc25Smrg retval = fs450_get_position(p_x, p_y); 686f29dbc25Smrg#endif 687f29dbc25Smrg return (retval); 688f29dbc25Smrg} 689f29dbc25Smrg 690f29dbc25Smrgint 691f29dbc25Smrggfx_set_position(int x, int y) 692f29dbc25Smrg{ 693f29dbc25Smrg int retval = -1; 694f29dbc25Smrg 695f29dbc25Smrg#if GFX_TV_FS451 696f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 697f29dbc25Smrg retval = fs450_set_position(x, y); 698f29dbc25Smrg#endif 699f29dbc25Smrg return (retval); 700f29dbc25Smrg} 701f29dbc25Smrg 702f29dbc25Smrg/* 703f29dbc25Smrg *========================================================================== 704f29dbc25Smrg * 705f29dbc25Smrg * Color, Brightness, and Contrast 706f29dbc25Smrg */ 707f29dbc25Smrg 708f29dbc25Smrgint 709f29dbc25Smrggfx_get_color(int *p_color) 710f29dbc25Smrg{ 711f29dbc25Smrg int retval = -1; 712f29dbc25Smrg 713f29dbc25Smrg#if GFX_TV_FS451 714f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 715f29dbc25Smrg retval = fs450_get_color(p_color); 716f29dbc25Smrg#endif 717f29dbc25Smrg return (retval); 718f29dbc25Smrg} 719f29dbc25Smrg 720f29dbc25Smrgint 721f29dbc25Smrggfx_set_color(int color) 722f29dbc25Smrg{ 723f29dbc25Smrg int retval = -1; 724f29dbc25Smrg 725f29dbc25Smrg#if GFX_TV_FS451 726f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 727f29dbc25Smrg retval = fs450_set_color(color); 728f29dbc25Smrg#endif 729f29dbc25Smrg return (retval); 730f29dbc25Smrg} 731f29dbc25Smrg 732f29dbc25Smrgint 733f29dbc25Smrggfx_get_brightness(int *p_brightness) 734f29dbc25Smrg{ 735f29dbc25Smrg int retval = -1; 736f29dbc25Smrg 737f29dbc25Smrg#if GFX_TV_FS451 738f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 739f29dbc25Smrg retval = fs450_get_brightness(p_brightness); 740f29dbc25Smrg#endif 741f29dbc25Smrg return (retval); 742f29dbc25Smrg} 743f29dbc25Smrg 744f29dbc25Smrgint 745f29dbc25Smrggfx_set_brightness(int brightness) 746f29dbc25Smrg{ 747f29dbc25Smrg int retval = -1; 748f29dbc25Smrg 749f29dbc25Smrg#if GFX_TV_FS451 750f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 751f29dbc25Smrg retval = fs450_set_brightness(brightness); 752f29dbc25Smrg#endif 753f29dbc25Smrg return (retval); 754f29dbc25Smrg} 755f29dbc25Smrg 756f29dbc25Smrgint 757f29dbc25Smrggfx_get_contrast(int *p_contrast) 758f29dbc25Smrg{ 759f29dbc25Smrg int retval = -1; 760f29dbc25Smrg 761f29dbc25Smrg#if GFX_TV_FS451 762f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 763f29dbc25Smrg retval = fs450_get_contrast(p_contrast); 764f29dbc25Smrg#endif 765f29dbc25Smrg return (retval); 766f29dbc25Smrg} 767f29dbc25Smrg 768f29dbc25Smrgint 769f29dbc25Smrggfx_set_contrast(int contrast) 770f29dbc25Smrg{ 771f29dbc25Smrg int retval = -1; 772f29dbc25Smrg 773f29dbc25Smrg#if GFX_TV_FS451 774f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 775f29dbc25Smrg retval = fs450_set_contrast(contrast); 776f29dbc25Smrg#endif 777f29dbc25Smrg return (retval); 778f29dbc25Smrg} 779f29dbc25Smrg 780f29dbc25Smrg/* 781f29dbc25Smrg *========================================================================== 782f29dbc25Smrg * 783f29dbc25Smrg * YC filters 784f29dbc25Smrg */ 785f29dbc25Smrg 786f29dbc25Smrgint 787f29dbc25Smrggfx_get_yc_filter(unsigned int *p_yc_filter) 788f29dbc25Smrg{ 789f29dbc25Smrg int retval = -1; 790f29dbc25Smrg 791f29dbc25Smrg#if GFX_TV_FS451 792f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 793f29dbc25Smrg retval = fs450_get_yc_filter(p_yc_filter); 794f29dbc25Smrg#endif 795f29dbc25Smrg return (retval); 796f29dbc25Smrg} 797f29dbc25Smrg 798f29dbc25Smrgint 799f29dbc25Smrggfx_set_yc_filter(unsigned int yc_filter) 800f29dbc25Smrg{ 801f29dbc25Smrg int retval = -1; 802f29dbc25Smrg 803f29dbc25Smrg#if GFX_TV_FS451 804f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 805f29dbc25Smrg retval = fs450_set_yc_filter(yc_filter); 806f29dbc25Smrg#endif 807f29dbc25Smrg return (retval); 808f29dbc25Smrg} 809f29dbc25Smrg 810f29dbc25Smrgint 811f29dbc25Smrggfx_get_aps_trigger_bits(unsigned int *p_trigger_bits) 812f29dbc25Smrg{ 813f29dbc25Smrg int retval = -1; 814f29dbc25Smrg 815f29dbc25Smrg#if GFX_TV_FS451 816f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 817f29dbc25Smrg retval = fs450_get_aps_trigger_bits(p_trigger_bits); 818f29dbc25Smrg#endif 819f29dbc25Smrg return (retval); 820f29dbc25Smrg} 821f29dbc25Smrg 822f29dbc25Smrgint 823f29dbc25Smrggfx_set_aps_trigger_bits(unsigned int trigger_bits) 824f29dbc25Smrg{ 825f29dbc25Smrg int retval = -1; 826f29dbc25Smrg 827f29dbc25Smrg#if GFX_TV_FS451 828f29dbc25Smrg if (gfx_tv_type & GFX_TV_TYPE_FS451) 829f29dbc25Smrg retval = fs450_set_aps_trigger_bits(trigger_bits); 830f29dbc25Smrg#endif 831f29dbc25Smrg return (retval); 832f29dbc25Smrg} 833f29dbc25Smrg 83404007ebaSmrg#endif /* GFX_TV_DYNAMIC */ 835f29dbc25Smrg 836f29dbc25Smrg/* END OF FILE */ 837