On Fri, Sep 08, 2006 at 06:27:17PM +0200, Stefan Lucke wrote:
> On Dienstag 05 September 2006 18:41, Stefan Lucke wrote:
> > On Montag 04 September 2006 23:01, Stefan Lucke wrote:
> > > On Donnerstag 22 Juni 2006 02:58, Ville Syrjälä wrote:
> > > > Hi,
> > > >
> > > > Field based blitting support for matrox cards is now in cvs.
> > >
> > > I know it's late, but I've been busy with other things.
> > >
> > > It still suffers from the same problem I wrote in a private mail
> > > to Ville on 2006-05-24:
> > >
> > > >> When the OSD is blended to screen surface, it is visible double high
> > > >> on one field. Sometimes there is a shadow from normal high OSD
> > > >> visible too.
> > > This shadow is more likely a shrinked picure of a previous frame.
> > > Should I make a screen shot to show this ?
> > >
> >
> > I think I found the bug: Whenever blit mode changes from field-blit to
> > frame-blit or vice versa, destination offsets have to be recalculated.
> > Attached patch will fix this issue for me and I think I'll get some
> > feedback on softdevice-devel list soon.
>
> As feedback from softdevice is positive:
> http://lists.berlios.de/pipermail/softdevice-devel/2006q3/002366.html
> http://lists.berlios.de/pipermail/softdevice-devel/2006q3/002361.html
> http://lists.berlios.de/pipermail/softdevice-devel/2006q3/002336.html
>
> Did you have a look at this Ville?
Yes, last night :) It's a bug alright. Source offset need to be
recalcuated too but I think we catch that via SMF_BLITTING_FLAGS and
SMF_DESTINATION. However, I think it makes sense to spell it out
explicitly, and I made a patch to do that (and shake other things around
for the heck of it), but I only had time to compile test it. I'm just
about to leave for the weekend so I won't commit it until next week.
I've attached the patch if you want to try it...
--
Ville Syrjälä
[EMAIL PROTECTED]
http://www.sci.fi/~syrjala/
Index: matrox.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox.c,v
retrieving revision 1.101
diff -u -r1.101 matrox.c
--- matrox.c 26 Aug 2006 09:34:19 -0000 1.101
+++ matrox.c 8 Sep 2006 17:31:47 -0000
@@ -705,6 +705,7 @@
{
MatroxDriverData *mdrv = (MatroxDriverData*) drv;
MatroxDeviceData *mdev = (MatroxDeviceData*) dev;
+ bool prev_blit_fields = mdev->blit_fields;
if (state->modified == SMF_ALL) {
mdev->valid = 0;
@@ -722,7 +723,7 @@
MGA_INVALIDATE( m_drawColor | m_blitColor | m_color );
if (state->modified & SMF_DESTINATION)
- MGA_INVALIDATE( m_color | m_Source | m_source );
+ MGA_INVALIDATE( m_destination | m_clip | m_color | m_Source |
m_source );
if (state->modified & SMF_SOURCE)
MGA_INVALIDATE( m_Source | m_source | m_SrcKey | m_srckey |
m_blitBlend );
@@ -759,6 +760,9 @@
mdev->blit_fields = 0;
}
+ if (prev_blit_fields != mdev->blit_fields)
+ MGA_INVALIDATE( m_destination | m_source | m_Source );
+
switch (accel) {
case DFXL_FILLRECTANGLE:
case DFXL_DRAWRECTANGLE:
@@ -896,12 +900,9 @@
break;
}
- if (state->modified & SMF_DESTINATION) {
- matrox_set_destination( mdrv, mdev, state->destination );
- state->modified |= SMF_CLIP;
- }
+ matrox_validate_destination( mdrv, mdev, state );
- if (state->modified & SMF_CLIP) {
+ if (!MGA_IS_VALID( m_clip )) {
mdev->clip = state->clip;
if (state->destination->format == DSPF_YUY2 ||
state->destination->format == DSPF_UYVY) {
mdev->clip.x1 /= 2;
@@ -912,6 +913,7 @@
mdev->clip.y2 /= 2;
}
matrox_set_clip( mdrv, mdev, &mdev->clip );
+ MGA_VALIDATE( m_clip );
}
state->modified = 0;
Index: matrox.h
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox.h,v
retrieving revision 1.41
diff -u -r1.41 matrox.h
--- matrox.h 22 Jun 2006 00:36:11 -0000 1.41
+++ matrox.h 8 Sep 2006 17:31:47 -0000
@@ -58,7 +58,10 @@
m_srckey = 0x0200,
m_drawBlend = 0x1000,
- m_blitBlend = 0x2000
+ m_blitBlend = 0x2000,
+
+ m_destination = 0x4000,
+ m_clip = 0x8000,
} MatroxStateBits;
#define MGA_VALIDATE(b) (mdev->valid |= (b))
Index: matrox_state.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox_state.c,v
retrieving revision 1.62
diff -u -r1.62 matrox_state.c
--- matrox_state.c 22 Jun 2006 00:36:11 -0000 1.62
+++ matrox_state.c 8 Sep 2006 17:31:47 -0000
@@ -130,15 +130,19 @@
}
}
-void matrox_set_destination( MatroxDriverData *mdrv,
- MatroxDeviceData *mdev,
- CoreSurface *destination )
+void matrox_validate_destination( MatroxDriverData *mdrv,
+ MatroxDeviceData *mdev,
+ CardState *state )
{
volatile __u8 *mmio = mdrv->mmio_base;
+ CoreSurface *destination = state->destination;
SurfaceBuffer *buffer = destination->back_buffer;
SurfaceBuffer *depth_buffer = destination->depth_buffer;
int bytes_per_pixel = DFB_BYTES_PER_PIXEL(buffer->format);
+ if (MGA_IS_VALID( m_destination ))
+ return;
+
mdev->dst_pitch = buffer->video.pitch / bytes_per_pixel;
mdev->depth_buffer = depth_buffer != NULL;
@@ -196,6 +200,8 @@
D_BUG( "unexpected pixelformat!" );
break;
}
+
+ MGA_VALIDATE( m_destination );
}
void matrox_set_clip( MatroxDriverData *mdrv,
@@ -564,6 +570,8 @@
mga_out32( mmio, 0, FXBNDRY );
mga_out32( mmio, PW16 | TLUTLOAD, MACCESS );
mga_out32( mmio, palette->num_entries, YDSTLEN | EXECUTE );
+
+ MGA_INVALIDATE( m_destination );
}
void matrox_validate_Source( MatroxDriverData *mdrv,
@@ -643,12 +651,10 @@
case DSPF_LUT8:
matrox_tlutload( mdrv, mdev, surface->palette );
texctl |= TW8;
- state->modified |= SMF_DESTINATION;
break;
case DSPF_RGB332:
matrox_tlutload( mdrv, mdev, mdev->rgb332_palette );
texctl |= TW8;
- state->modified |= SMF_DESTINATION;
break;
default:
D_BUG( "unexpected pixelformat!" );
Index: matrox_state.h
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/matrox/matrox_state.h,v
retrieving revision 1.6
diff -u -r1.6 matrox_state.h
--- matrox_state.h 1 Apr 2005 07:00:42 -0000 1.6
+++ matrox_state.h 8 Sep 2006 17:31:47 -0000
@@ -28,9 +28,9 @@
#ifndef ___MATROX_STATE_H__
#define ___MATROX_STATE_H__
-void matrox_set_destination( MatroxDriverData *mdrv,
- MatroxDeviceData *mdev,
- CoreSurface *destination );
+void matrox_validate_destination( MatroxDriverData *mdrv,
+ MatroxDeviceData *mdev,
+ CardState *state );
void matrox_set_clip( MatroxDriverData *mdrv,
MatroxDeviceData *mdev,
DFBRegion *clip );
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev