I want to output Digital RGB565 to a THS8200 chip over the Y/C outputs (or would it be better to output YCbCr and convert in the THS8200?). My final output is a VGA connector which is RGB. Has anyone done this?
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
BMillikan said:I want to output Digital RGB565 to a THS8200 chip over the Y/C outputs (or would it be better to output YCbCr and convert in the THS8200?). My final output is a VGA connector which is RGB. Has anyone done this?
By quickly looking at the hardware data-sheets, it would appear you can take either approach, output RGB from DM644X into THS8200, or output YCbCr from DM644x and have THS8200 convert to RGB. Unfortunately, I have not tried either personally.
Do you need Analog VGA output? A more common solution is to output RGB from DM644X and interface directly into digital LCD display (with little or no glue logic), this bypasses the need for a DAC device such as THS8200. However, if you require analog VGA, then THS8200 should work.
I'm assuming you want to display colors bars from the DaVinci to the THS8200? I don't believe the DM644x has the capability of displaying colorbars through the digital video interface at an arbitrary resolution. What I did was obtain a test bitmap image and converted it to RGB565 and put it into RAM. You could find a colorbars image the proper size and do the same. Output that image over the YC interface using the OSD of the DaVinci (I used the OSD0 plane which converted the RGB565 to a YCbCr image and sent it over the YC interface). I'm sure you can wire up the DaVinci to output RGB888 to the THS8200, but we have it set up like the THS8200 daughter card. I think this would be your best bet. I was able to get this working. Let me know if you have any questions.
ash krishna said:I want to display RGB colorbar using THS8200 which is to be displayed on a monitor with the help of VGA connector. I do not need Ycbcr components. Can anyone help me?
To add to BMilikan's suggestion, please note that if your intent is to output digital RGB to a display monitor... then you probrably do not need the THS8200 at all; a simpler (lest costly) circuitry such as the one depicted in the LCD daughter-card solution described in this app note should suffice: http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraan0
BTW, I have not tried it but do believe color bar pattern can be output in RGB video output mode as well; you see, this data is generated at the OSD level in YCbCr format; however, by selecting RGB output mode, you are simply requesting a color space conversion of whatever is available at the OSD level..at least this is my understanding; unfortunately, I do not have the necessary hardware to test this out.
hello
I am working on DM648 board. As i do not have s video cable.. I want to display on monitor informatic.. So I am using THS8200.I have to display RGB color bar. Its generatd.. but i do not know how to display RGB color bar using VGA and THS8200.. Could you please help me? Thanks in advance..
Apologies, the title of the post threw me off and thought you were working on our DM644x devices (as opposed to DM64x); please disregard my previous post as I am not sure what our video output port capabilities are on DM648. I will see if someone more familiar with DM648 can chime in.
If you are using DM648 EVM, then there are sample application to display 16-bit VGA color bar on THS8200 in PSP driver package.
It could be found @ "pspdrivers_1_10_XX\packages\ti\sdo\pspdrivers\system\dm648\bios\evmDM648\video\sample\build\vesa_colorbar" in the PSP package
If you are using a custom board, then you can use the example and driver as a reference.
Could anyone tell me what is the maximum resolution for THS8200 using vesa color bar(RGB).RGB color bar displays for VGA(620 pixels,480 lines). But it doesn't display when defined for XGA(1024 pixels,768 lines). Its giving as out of range as 20.1 KHZ / 25HZ. Could anyone help me.. I am using THS8200 on DM648 board..
What are you using for you timing input to the THS8200? Are you using the CDCE939 clock chip? What is your pixel clock set to? What are your timing registers on the DaVinci set to? Do you have the THS8200 set in to MASTER or SLAVE mode?
To answer your question about maximum resolution on the THS8200, that really depends on the ability of your clock chip input. That is why the THS8200 needs an external clock chip source for the timing. It can display up to an HD 1920x1080 resolution picture (and maybe higher if your monitor can handle it), but the issue is that you need a pixel clock that is fast enough to clock it and generate the appropriate HSYNC and VSYNC signals. I suppose the limit is really the maximum clock rate the THS8200 can handle.
/*******************************************************************************
**+--------------------------------------------------------------------------+**
**| **** |**
**| **** |**
**| ******o*** |**
**| ********_///_**** |**
**| ***** /_//_/ **** |**
**| ** ** (__/ **** |**
**| ********* |**
**| **** |**
**| *** |**
**| |**
**| Copyright (c) 1998-2007 Texas Instruments Incorporated |**
**| ALL RIGHTS RESERVED |**
**| |**
**| Permission is hereby granted to licensees of Texas Instruments |**
**| Incorporated (TI) products to use this computer program for the sole |**
**| purpose of implementing a licensee product based on TI products. |**
**| No other rights to reproduce, use, or disseminate this computer |**
**| program, whether in part or in whole, are granted. |**
**| |**
**| TI makes no representation or warranties with respect to the |**
**| performance of this computer program, and specifically disclaims |**
**| any responsibility for any damages, special or consequential, |**
**| connected with the use of this program. |**
**| |**
**+--------------------------------------------------------------------------+**
*******************************************************************************/
/** \file psp_bios_vport_vesa_colorbar.c
*
* \brief This file contains the function which displays vertical colorbar
* in VGA, SVGA, XGA and SXGA VESA resolutions. This application
* uses the NEW FVID APIs.
*
*/
/*
* ========== INCLUDE FILES ===========
*/
#include <std.h>
#include <log.h>
#include <string.h>
#include <bcache.h>
#include <stdio.h>
#include <ti/sdo/pspdrivers/system/dm648/bios/evmDM648/video/fvid.h>
#include <ti/sdo/pspdrivers/drivers/vport/edc.h>
#include <ti/sdo/pspdrivers/drivers/vport/vport.h>
#include <ti/sdo/pspdrivers/drivers/vport/vportdis.h>
#include <ti/sdo/pspdrivers/system/dm648/bios/evmDM648/video/sample/psp_bios_vport_common.h>
#include <ti/sdo/pspdrivers/system/dm648/bios/evmDM648/video/sample/psp_bios_vport_disParams.h>
/*
* ======== USER CONFIGURABLE MACROS ========
*/
/*
* Video Mode
*
* Set this macro to any one of the following video modes
*
* MODE_VGA_60HZ - To display color bars in VGA 60Hz resolution
* MODE_VGA_72HZ - To display color bars in VGA 72Hz resolution
* MODE_VGA_75HZ - To display color bars in VGA 75Hz resolution
* MODE_VGA_85HZ - To display color bars in VGA 85Hz resolution
* MODE_SVGA_60HZ - To display color bars in SVGA 60Hz resolution
* MODE_SVGA_72HZ - To display color bars in SVGA 72Hz resolution
* MODE_SVGA_75HZ - To display color bars in SVGA 75Hz resolution
* MODE_SVGA_85HZ - To display color bars in SVGA 85Hz resolution
* MODE_XGA_60HZ - To display color bars in XGA 60Hz resolution
* MODE_XGA_70HZ - To display color bars in XGA 70Hz resolution
* MODE_SXGA_60HZ - To display color bars in SXGA 60Hz resolution
*
*/
#define CFG_VIDEO_MODE (MODE_VGA_85HZ)
/*
* Number of frames for color bar display
*
* This sample application will run for 'CFG_NUM_FRAME_COUNT' amount of frames.
* After which the application will close.
*/
#define CFG_NUM_FRAME_COUNT (1000000u)
/*
* Enable or disable double word byte swap function
*
* Set this macro as 1/0 to enable or disable double word byte swap software
* work around for Video Port endian issue
*
* 1 - Enable double word byte swap
* 0 - Disable double word byte swap
*
*/
#define CFG_ENABLE_DOUBLEWORD_BYTE_SWAP (1)
/*
* ======== DEFINES =========
*/
/* Number of frame buffers to allocate per driver instance */
#define NUM_FRAME_BUFFERS (3)
/* Number of Horizontal Pixels */
#define NUMPIXELS (800)
/* Number of Lines */
#define NUMLINES (600)
#if (CFG_VIDEO_MODE == MODE_VGA_60HZ) || (CFG_VIDEO_MODE == MODE_VGA_72HZ) || \
(CFG_VIDEO_MODE == MODE_VGA_75HZ) || (CFG_VIDEO_MODE == MODE_VGA_85HZ)
/* Number of Horizontal Pixels */
#define NUMPIXELS (640)
/* Number of Lines */
#define NUMLINES (480)
#endif /* #if (CFG_VIDEO_MODE == MODE_VGA) */
#if (CFG_VIDEO_MODE == MODE_SVGA_60HZ) || (CFG_VIDEO_MODE == MODE_SVGA_72HZ) ||\
(CFG_VIDEO_MODE == MODE_SVGA_75HZ) || (CFG_VIDEO_MODE == MODE_SVGA_85HZ)
/* Number of Horizontal Pixels */
#define NUMPIXELS (800)
/* Number of Lines */
#define NUMLINES (600)
#endif /* #if (CFG_VIDEO_MODE == MODE_SVGA) */
#if (CFG_VIDEO_MODE == MODE_XGA_60HZ) || (CFG_VIDEO_MODE == MODE_XGA_70HZ)
/* Number of Horizontal Pixels */
#define NUMPIXELS (1024)
/* Number of Lines */
#define NUMLINES (768)
#endif /* #if (CFG_VIDEO_MODE == MODE_XGA) */
//#if (CFG_VIDEO_MODE == MODE_SXGA_60HZ)
// Number of Horizontal Pixels */
//#define NUMPIXELS (1280)
// Number of Lines */
//#define NUMLINES (1024)
//#endif /* #if (CFG_VIDEO_MODE == MODE_SXGA) */
/* Frame size in bytes */
#define FRAME_SIZE (NUMPIXELS * NUMLINES * 2)
//#define DISP_STD (DISP_STD_PAL)
/* 16-bit RGB values used in color bar */
#define WHITE (0xBDF7)
#define YELLOW (0xC5E0)
#define CYAN (0x05F7)
#define GREEN (0x05E0)
#define MAGENTA (0xB818)
#define RED (0xB800)
#define BLUE (0x0017)
#define BLACK (0x0000)
//#if (DISP_STD == DISP_STD_PAL)
//#define DISP_LINE_SZ (720)
//#define DISP_NUM_LINES_PER_FLD (576)
//#endif
/*
* ======== GLOBALS =========
*/
/* Video Port configuration parameters for display.
Using default value.
Note: This variable is used in BIOS TCF file. */
VPORT_PortParams vDisParamsPort = DIS_PARAMS_PORT_DEFAULT;
/* Global variable to check the current frame count in CCS watch window */
Uint32 AppVesaFrameCnt = 0;
/* Buffer to store a line of color bar */
static Uint16 imgLineRGB[NUMPIXELS * 3];
/* Vport Display driver configuration */
//static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_XGA_60HZ_DEFAULT;
#if (CFG_VIDEO_MODE == MODE_VGA_60HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChanTHS8200 = DIS_PARAMS_CHAN_VGA_60HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_VGA_60HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_VGA_60HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_VGA_60HZ) */
#if (CFG_VIDEO_MODE == MODE_VGA_72HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_VGA_72HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_VGA_72HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_VGA_72HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_VGA_72HZ) */
#if (CFG_VIDEO_MODE == MODE_VGA_75HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_VGA_75HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_VGA_75HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_VGA_75HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_VGA_75HZ) */
#if (CFG_VIDEO_MODE == MODE_VGA_85HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_VGA_85HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_VGA_85HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_VGA_85HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_VGA_85HZ) */
#if (CFG_VIDEO_MODE == MODE_SVGA_60HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_SVGA_60HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_SVGA_60HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_SVGA_60HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_SVGA_60HZ) */
#if (CFG_VIDEO_MODE == MODE_SVGA_72HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_SVGA_72HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_SVGA_72HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_SVGA_72HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_SVGA_72HZ) */
#if (CFG_VIDEO_MODE == MODE_SVGA_75HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_SVGA_75HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_SVGA_75HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_SVGA_75HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_SVGA_75HZ) */
#if (CFG_VIDEO_MODE == MODE_SVGA_85HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_SVGA_85HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_SVGA_85HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_SVGA_85HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_SVGA_85HZ) */
/*Vport Display driver configuration */
//static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_XGA_60HZ_DEFAULT;
/* THS8200 EDC driver configuration */
//static THS8200_ConfParams vDisParamsEncoder
// = DIS_PARAMS_THS8200_XGA_60HZ_DEFAULT;
#if (CFG_VIDEO_MODE == MODE_XGA_60HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_XGA_60HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_XGA_60HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_XGA_60HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_XGA_60HZ) */
#if (CFG_VIDEO_MODE == MODE_XGA_70HZ)
/* Vport Display driver configuration */
static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_XGA_70HZ_DEFAULT;
static THS8200_ConfParams vDisParamsTHS8200[1] =
{
{ THS8200_MODE_XGA_70HZ,
THS8200_IFMT_YCBCR422_20_BIT,
THS8200_AFMT_RGB_NO_SYNC,
TRUE,
TRUE }
};
/* THS8200 EDC driver configuration */
static THS8200_ConfParams vDisParamsEncoder
= DIS_PARAMS_THS8200_XGA_70HZ_DEFAULT;
#endif /* #if (CFG_VIDEO_MODE == MODE_XGA_70HZ) */
//#if (CFG_VIDEO_MODE == MODE_SXGA_60HZ)
// Vport Display driver configuration */
//static VPORTDIS_Params vDisParamsChan = DIS_PARAMS_CHAN_SXGA_60HZ_DEFAULT;
// THS8200 EDC driver configuration */
//static THS8200_ConfParams vDisParamsEncoder
// = DIS_PARAMS_THS8200_SXGA_60HZ_DEFAULT;
//#endif /* #if (CFG_VIDEO_MODE == MODE_SXGA_60HZ) */
/*
* ============= FUNC DECLARATIONS ==============
*/
#if (CFG_ENABLE_DOUBLEWORD_BYTE_SWAP == 1)
/* Function which does the 8-byte swapping - Software fix for big endian mode
operation of Video Port */
extern void double_word_byte_swap(Uint8 *bufferPtr, Uint32 numOfBytes);
#endif /* #if (CFG_ENABLE_DOUBLEWORD_BYTE_SWAP == 1) */
extern EDMA3_DRV_Result edma3init(void);
static Int32 test_vesa_colorbar(EDMA3_DRV_Handle hEdma,
Uint32 frameCnt,
Int32 sedId);
static void generateColorBarRGB(Uint16* buf, Uint32 lineSize);
static void fill_colorbar(Uint8 *buffer, Uint32 lineSize, Uint32 numLines,
Int32 offset);
/*
* ============= EXTERNS ==============
*/
#ifdef _6x_
extern far LOG_Obj trace;
#else
extern LOG_Obj trace;
#endif
/* Heap ID defined in the BIOS configuration file.
This memory segment is used to allocate video frame buffers. */
extern Int EXTERNALHEAP;
/* EDMA handle */
extern EDMA3_DRV_Handle hEdma;
/*
* ============= DEFINITIONS ==============
*/
/*
* ======== tskVesaColorbar ========
* Video application test task.
* Created as a separate task in BIOS TCF file.
*/
void tskVesaColorbar(void)
{
EDMA3_DRV_Result result = EDMA3_DRV_SOK;
/* Initialize EDMA3 driver */
result = edma3init();
if (EDMA3_DRV_SOK != result)
{
LOG_printf(&trace, "Can't initialized EDMA3");
return;
}
/* Run VESA colorbar application */
test_vesa_colorbar(hEdma, CFG_NUM_FRAME_COUNT, EXTERNALHEAP);
}
/*
* ======== test_vesa_colorbar ========
* VESA colorbar function
* Function which performs VESA vertical colorbar display
* hEdma - Handle to the EDMA3 driver
* totalFrameCnt - Number of frames for display operation
* sedId - Heap ID where the driver FVID buffers will be allocated
*/
static Int32 test_vesa_colorbar(EDMA3_DRV_Handle hEdma,
Uint32 totalFrameCnt,
Int32 sedId)
{
Int status = IOM_COMPLETED;
Int frames, bufCount;
/* Array containing display and capture channel information */
ChannelInfo disChInfo;
/* Array containing display driver name strings
Use this strings as they are for proper driver creation */
Int8 *vPortDisStrings = "/VP1DISPLAY/THS8200";
if (!totalFrameCnt)
{
LOG_printf(&trace, "Give non-zero frame count\n");
return -1;
}
/* Allocate both capture and display frame buffers
in external heap memory */
vDisParamsChan.segId = sedId;
/* Assign EDMA3 driver handle to channel params */
vDisParamsChan.hEdma = hEdma;
/*
* Assign number of frame buffers as 0 for using NEW FVID APIs
*/
vDisParamsChan.numFrmBufs = 0;
/* Create and configure display driver */
disChInfo.chanHandle = FVID_create(vPortDisStrings,
IOM_OUTPUT,
&status,
(Ptr)&vDisParamsChan,
NULL);
if (IOM_COMPLETED != status)
{
LOG_printf(&trace, "Failed to create display channels\n");
}
/* Allocate and Queue buffers for display driver */
if (IOM_COMPLETED == status)
{
for (bufCount = 0; bufCount < NUM_FRAME_BUFFERS; bufCount++)
{
/* Allocate Frame buffer for display driver */
status = FVID_allocBuffer(disChInfo.chanHandle, &(disChInfo.frame));
if (IOM_COMPLETED != status)
{
LOG_printf(&trace, "Failed to allocate buffer\n");
break;
}
/* Queue the buffers */
status = FVID_queue(disChInfo.chanHandle, &(disChInfo.frame));
if (IOM_COMPLETED != status)
{
LOG_printf(&trace, "Failed to Queue buffer\n");
break;
}
}
}
else
{
LOG_printf(&trace, "Failed to open - Display channel\n");
}
/* Configure external video encoder (THS8200) */
if (IOM_COMPLETED == status)
{
/* Configure THS8200 */
status = FVID_control(disChInfo.chanHandle,
VPORT_CMD_EDC_BASE + EDC_CONFIG,
(Ptr)&vDisParamsEncoder);
}
else
{
LOG_printf(&trace, "Failed to init display channel\n");
}
/* Start display operation */
if (IOM_COMPLETED == status)
{
status = FVID_control(disChInfo.chanHandle,
VPORT_CMD_START,
NULL);
}
else
{
LOG_printf(&trace, "Failed to configure disp channel device\n");
}
/* Request a frame buffer from display driver */
if (IOM_COMPLETED == status)
{
/* Display buffer will return a free buffer */
status |= FVID_dequeue(disChInfo.chanHandle, &(disChInfo.frame));
}
else
{
LOG_printf(&trace, "Failed to start display driver\n");
}
if (IOM_COMPLETED == status)
{
frames = 0;
while (frames < totalFrameCnt)
{
fill_colorbar((Uint8 *)disChInfo.frame->frame.rpFrm.buf,
NUMPIXELS, NUMLINES, 0);
#if (CFG_ENABLE_DOUBLEWORD_BYTE_SWAP == 1)
/* Fix for Video Port bigendian mode - This is for display port */
double_word_byte_swap((Uint8 *)disChInfo.frame->frame.rpFrm.buf,
FRAME_SIZE);
#endif /* #if (CFG_ENABLE_DOUBLEWORD_BYTE_SWAP == 1) */
/* Flush and invalidate the processed buffer so that the EDMA reads
the processed data */
BCACHE_wbInv((Uint8 *)disChInfo.frame->frame.rpFrm.buf,
(FRAME_SIZE),
TRUE);
/* Give the filled frame buffer to display driver and get a
free frame buffer for next filling */
status |= FVID_exchange(disChInfo.chanHandle,
&(disChInfo.frame));
/* LOG_printf(&trace, "%d\n", frames); */
if (IOM_COMPLETED != status)
{
LOG_printf(&trace, "IOM_COMPLETED != status\n");
break;
}
frames++;
/* Update global frame count for check purpose */
AppVesaFrameCnt = frames;
}/* while (frame count) */
/* Stop display operation */
if (IOM_COMPLETED == status)
{
status |= FVID_control(disChInfo.chanHandle,
VPORT_CMD_STOP,
NULL);
/* Free the buffer owned by application */
status |= FVID_freeBuffer(disChInfo.chanHandle,
&(disChInfo.frame));
/* Dequeue buffers from driver and free them */
for (bufCount = 0; bufCount < (NUM_FRAME_BUFFERS - 1); bufCount++)
{
status |= FVID_dequeue(disChInfo.chanHandle,
&(disChInfo.frame));
status |= FVID_freeBuffer(disChInfo.chanHandle,
&(disChInfo.frame));
}
}
else
{
LOG_printf(&trace, "Failed to alloc or exchange buffers\n");
}
/* Delete display drivers */
if (IOM_COMPLETED == status)
{
status |= FVID_delete(disChInfo.chanHandle);
if (IOM_COMPLETED == status)
{
LOG_printf(&trace, "Application closed successfully!!\n");
}
}
else
{
LOG_printf(&trace, "Failed to stop display channel\n");
}
}
else if (IOM_COMPLETED != status)
{
LOG_printf(&trace, "Failed to alloc or exchange buffers\n");
}
return status;
}
/*
* ======== fill_colorbar ========
* This function fills the given buffer with one frame of color bar in RGB565
* format.
* buffer - Frame buffer pointer
* lineSize - Number of samples (16-bit) per line
* numLines - Number of lines per frame
* offset - Used for moving color bar
*/
void fill_colorbar(Uint8 *buffer, Uint32 lineSize, Uint32 numLines,
Int32 offset)
{
Uint32 i;
static Int32 init = 0;
if (!init)
{
generateColorBarRGB(imgLineRGB, lineSize);
init = 1;
}
for (i = 0; i < numLines; i++)
{
memcpy(buffer + (lineSize << 1) * i, imgLineRGB + offset * 8,
(lineSize << 1));
}
return;
}
/*
* ======== generateColorBarRGB ========
* This function generates a line of color bar with RGB565 format.
* lineBuf - Line buffer pointer
* lineSize - Number of samples (16-bit) per line
*/
static void generateColorBarRGB(Uint16 *lineBuf, Uint32 lineSize)
{
Int i;
Int fillSize = lineSize >> 3;
Int k;
for (k = 0; k < 3; k++)
{
for (i = 0; i < fillSize; i++)
{
lineBuf[fillSize * 0 + i] = WHITE;
lineBuf[fillSize * 1 + i] = BLACK;
lineBuf[fillSize * 2 + i] = CYAN;
lineBuf[fillSize * 3 + i] = GREEN;
lineBuf[fillSize * 4 + i] = MAGENTA;
lineBuf[fillSize * 5 + i] = RED;
lineBuf[fillSize * 6 + i] = BLUE;
lineBuf[fillSize * 7 + i] = YELLOW;
}
lineBuf += lineSize;
}
}
/******************************************************************************/
/* End of file */
/******************************************************************************/
this is my program.. could you help me.. i do not its only working for VGA with all frequencies60,72,75 and 85 HZ.. not even with SVGA..
The code for the THS8200 is in the drivers/media/video/davinci/ths8200_encoder.c and the setttings are in include/media/davinci/ths8200_encoder.h. At the top of the "c" code is several settings for the THS8200. The setting will be determined by what your bootargs are set to (it will set the encoder and the "mode" for the encoder). You need to set the "output" and "mode" for the encoder through the bootargs to tell Linux which encoder and which mode to use. For each mode, there is associated register settings and there you can determine what mode the THS8200 will be in.
As for the DaVinci, depending on which kernel you are using (TI or MontaVista), the timing registers are typically set in the drivers/media/video/davinci/davinci_platform.c file. Look in there for the "mode" you are interested in and there is a function that sets the timing registers. Take a look at that for your resolution. If you want to add a new resolution, you will need to add a new function here as well as a new setting in the ths8200_encoder.c file (at the top).
Hope this helps.
BMillikan said:I want to output Digital RGB565 to a THS8200 chip over the Y/C outputs (or would it be better to output YCbCr and convert in the THS8200?). My final output is a VGA connector which is RGB. Has anyone done this?
Please note DM6446 has a built in LCD controller; therefore if all you need is RGB VGA output, you do not need a THS8200 device at all; please refer to the second part of the following App Note, it implements RGB 565 VGA output (schematic for solution included)
http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraan0
ash krishna said:Hello,
I tried everything. Nothing works out..I have put my program..could you pls tell me...can you try it....its just working for vga..neither SVGA nor XGA.. Pl help me out..
Unfortunately, I have not tried SVGA or XGA, but I would suspect these would be very similar to VGA (touch same set of registers); perhaps the app note mentioned above (http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spraan0 ) may help you double check all registers mention in the App Note have been configured properly