On Donnerstag 14 September 2006 03:32, Stefan Lucke wrote:
> Hi,
>
> for colorkeying did not work with the following onboard graphic:
> 00:02.0 VGA compatible controller: Intel Corporation 82852/855GM Integrated
> Graphics Device (rev 02)
>
> Softdevice OSD was only shown in that area where no video was drawn.
> Base thread of this discussion (in german) is here:
> http://www.vdr-portal.de/board/thread.php?threadid=54640
>
> Allthough it is still unresolved for original reporter, the attached patch
> solves the issue for me.
> Changes are similar to code from Xorg:
> http://webcvs.freedesktop.org/xorg/driver/xf86-video-i810/src/i830_video.c?annotate=1.22
> line 508 .
So here come a modified second version, which allows to choose the required PIPE
for the videolayer via directfbrc. Just place "i8xx_overlay_pipe_b" in
directfbrc and
videolayer is redirected to PIPE_B .
An additionl modification is done to set the colorkey for other pixel depths.
Colorkey register holds an RGB32 value and set bits in mask register
specify those which are _not_ relevant for colorkeying.
--
Stefan Lucke
? gfxdrivers/i830/dfb-i830-colorkey-02.diff
Index: gfxdrivers/i830/i830_overlay.c
===================================================================
RCS file: /cvs/directfb/DirectFB/gfxdrivers/i830/i830_overlay.c,v
retrieving revision 1.5
diff -U 3 -r1.5 i830_overlay.c
--- gfxdrivers/i830/i830_overlay.c 1 May 2006 18:51:52 -0000 1.5
+++ gfxdrivers/i830/i830_overlay.c 23 Sep 2006 15:36:40 -0000
@@ -62,7 +62,7 @@
#include <gfx/convert.h>
-
+#include <misc/conf.h>
#define I830_OVERLAY_SUPPORTED_OPTIONS (DLOP_DST_COLORKEY)
@@ -765,17 +765,38 @@
/*
* Destination color keying.
*/
+ regs->DCLRKV = PIXEL_RGB32 (config->dst_key.r, config->dst_key.g, config->dst_key.b );
- primary_format = dfb_primary_layer_pixelformat();
-
- regs->DCLRKV = dfb_color_to_pixel( primary_format,
- config->dst_key.r, config->dst_key.g, config->dst_key.b );
+ switch (DFB_COLOR_BITS_PER_PIXEL( primary_format )) {
+ case 8:
+ regs->DCLRKM = 0xffffff;
+ break;
+ case 15:
+ regs->DCLRKM = 0x070707;
+ break;
+ case 16:
+ regs->DCLRKM = 0x070307;
+ break;
+ default:
+ regs->DCLRKM = 0;
+ break;
+ }
- regs->DCLRKM = (1 << DFB_COLOR_BITS_PER_PIXEL( primary_format )) - 1;
+ if(dfb_config->i8xx_overlay_pipe_b)
+ regs->OCONFIG |= OVERLAY_PIPE_B;
if (config->options & DLOP_DST_COLORKEY)
regs->DCLRKM |= DEST_KEY_ENABLE;
+ /*
+ * Disable source color keying if not selected
+ */
+ if (!(config->options & DLOP_SRC_COLORKEY)) {
+ regs -> SCLRKVH = 0;
+ regs -> SCLRKVL = 0;
+ regs -> SCLRKEN = 0;
+ }
+
//D_INFO("OCMD is 0x%08x\n", regs->OCMD);
}
Index: src/misc/conf.c
===================================================================
RCS file: /cvs/directfb/DirectFB/src/misc/conf.c,v
retrieving revision 1.111
diff -U 3 -r1.111 conf.c
--- src/misc/conf.c 20 Jun 2006 19:34:51 -0000 1.111
+++ src/misc/conf.c 23 Sep 2006 15:36:44 -0000
@@ -127,6 +127,7 @@
" mut-device=<device> Use this device for the MuTouch driver\n"
" penmount-device=<device> Use this device for the PenMount driver\n"
" unichrome-revision=<rev> Override unichrome hardware revision\n"
+ " i8xx_overlay_pipe_b Redirect videolayer to pixelpipe B\n"
"\n"
" Window surface swapping policy:\n"
" window-surface-policy=(auto|videohigh|videolow|systemonly|videoonly)\n"
@@ -343,6 +344,7 @@
dfb_config->dma = false;
dfb_config->agp = 0;
dfb_config->matrox_tv_std = DSETV_PAL;
+ dfb_config->i8xx_overlay_pipe_b = false;
/* default to fbdev */
dfb_config->system = D_STRDUP( "FBDev" );
@@ -1086,6 +1088,9 @@
D_ERROR("DirectFB/Config 'unichrome-revision': No revision specified!\n");
return DFB_INVARG;
}
+ } else
+ if (strcmp (name, "i8xx_overlay_pipe_b") == 0) {
+ dfb_config->i8xx_overlay_pipe_b = true;
}
else
return DFB_UNSUPPORTED;
Index: src/misc/conf.h
===================================================================
RCS file: /cvs/directfb/DirectFB/src/misc/conf.h,v
retrieving revision 1.62
diff -U 3 -r1.62 conf.h
--- src/misc/conf.h 20 Jun 2006 19:34:51 -0000 1.62
+++ src/misc/conf.h 23 Sep 2006 15:36:44 -0000
@@ -149,6 +149,7 @@
int agp; /* AGP mode */
int agpmem_limit; /* Limit of AGP memory
used by DirectFB */
+ bool i8xx_overlay_pipe_b; /* video overlay output via pixel pipe B */
} DFBConfig;
extern DFBConfig *dfb_config;
_______________________________________________
directfb-dev mailing list
[email protected]
http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev