Hello again,
Sorry for my persistent questions - this will be one of the last, I
promise.. :-)
Further to my questions about software blitting for the hardware MPEG
decoder I decided I'd have a look at the ddmpeg code to see how it did the
blitting using the HQV window.
I have replaced the 'blit' call with the following. The theory is that this
uses the HQV hardware to copy the MPEG framebuffer to the V1 buffer. It is
sort of working (VDR with the softdevice plugin uses 20-30% CPU for video
playback and sound playback + sync etc.) There is only one problem... it
displays garbage! :-(
It's sort of relevant garbage though - it changes with the picture which
should be displayed.
I think I've got the settings for HQV_DST_STRIDE and HQV_SRC_FETCH_LINE
wrong. I'm using the following code to display the picture:
void hwdec_display_picture(uint8_t* mmio,
uint32_t y_off,
uint32_t u_off,
uint32_t v_off)
{
unsigned long hqvControl;
// WaitHQVDone...
while (*VIDEO_IO(HQV_CONTROL) & 0x10);
// Wait for V1 video to be ready...
while (*VIDEO_IO(V_COMPOSE_MODE) & V1_COMMAND_FIRE);
// Set the HQV source address to the MPEG buffer to display and
// the destination to the V1 window.
*VIDEO_IO(HQV_SRC_STARTADDR_Y) = y_off;
*VIDEO_IO(HQV_SRC_STARTADDR_U) = u_off;
*VIDEO_IO(HQV_SRC_STARTADDR_V) = v_off;
*VIDEO_IO(HQV_DST_STARTADDR0) = *VIDEO_IO(V1_STARTADDR_0);
*VIDEO_IO(HQV_DST_STARTADDR1) = *VIDEO_IO(V1_STARTADDR_1);
hqvControl = HQV_YUV420 |
HQV_ENABLE |
HQV_FLIP_EVEN |
HQV_IDLE |
HQV_SW_FLIP |
HQV_FLIP_STATUS;
*VIDEO_IO(HQV_CONTROL) = hqvControl;
}
... and setting the code up with the following:
void hwdec_set_fb_stride(uint8_t* mmio,
uint32_t y_stride, uint32_t uv_stride)
{
int stride = (y_stride >> 3) | ((uv_stride >> 3) << 16);
*MPEG_IO(0x50) = stride;
*VIDEO_IO(HQV_SRC_STRIDE) = stride;
#warning Move this code into the video initialisation code/set the DirectFB
surface appropriately &&&
*VIDEO_IO(V1_CONTROL) = 0x02050081; // &&& Convert this into constants
*VIDEO_IO(V_COMPOSE_MODE) = *VIDEO_IO(V_COMPOSE_MODE) |
V1_COMMAND_FIRE | V_COMMAND_LOAD_VBI;
*VIDEO_IO(HQV_DST_STRIDE) = *VIDEO_IO(V1_STRIDE);
int dwPitch = y_stride >> 3;
#warning The picture height must not be hardcoded
*VIDEO_IO(HQV_SRC_FETCH_LINE) = ((dwPitch-1)<<16) | 575;
*VIDEO_IO(HQV_FILTER_CONTROL) = 0x420040;
*VIDEO_IO(HQV_MINIFY_CONTROL) = 0;
}
Can anyone shed any light on what I'm doing wrong? I had a look through the
ddmpeg.c code in the kernel and tried a few things - but I obviously got
something dumb wrong.
Once that happens then the hardware decoder will work with DirectFB. Whoo!
Thanks a lot,
Colin
--
Info: To unsubscribe send a mail to [EMAIL PROTECTED] with
"unsubscribe directfb-dev" as subject.