Hello,

I know, its a little bit off topic, but I think in this list are the most people who are interested in this.

ivtv Gentoo users cannot compile ivtvdev at the time because of compatibily reasons of the xdrivers source code to xorg 7.1. Ian Campbell wrote a patch to get it working under debian. the most Gentoo users uses his binary. I modified the patch to get ivtvdev to work with Gentoo and xorg 7.1. Here is a little Howto:

1. Google for fbpriv.h and copy it to /usr/include/xorg
2. Create /usr/local/portage/x11-drivers
3. Add to /etc/make.conf: PORTDIR_OVERLAY="/usr/local/portage"
4. Copy the xf86-video-ivtvdev directory from /usr/portage/x11-drivers to you new overlay. All changes will be made there! 5. Copy the patch to /usr/local/portage/x11-drivers/xf86-video-ivtvdev/files/ 6. Edit xf86-video-ivtvdev-0.10.6.ebuild and change the patchname from ivtv_xdriver-unified.patch to ivtv.patch and =x11-base/xorg-server-1.0.2-r7 to 1.1.1-r4 7. In /usr/local/portage/x11-drivers/xf86-video-ivtvdev run: ebuild xf86-video-ivtvdev-0.10.6.ebuild digest
8. Run: emerge -av xf86-video-ivtvdev
9. Restart X


I hope this is useful for some people. Any suggestions where to put the Howto and the Patch? I aready sent it to Jeff Gardner.

Cheers,

Wilhelm

PS: The patch ist attached
Index: 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvdev.c
===================================================================
--- 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvdev.c
   2005-08-30 22:27:18.000000000 +0200
+++ 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvdev.c
   2005-08-30 22:27:18.000000000 +0200
@@ -4,13 +4,13 @@
  * Authors:  Alan Hourihane, <[EMAIL PROTECTED]>
  *          Michel Dänzer, <[EMAIL PROTECTED]>
  */
+#include <string.h>
 
 #include "ivtvhw.h"
 #include "ivtvdev.h"
 /* all driver need this */
 #include "xf86.h"
 #include "xf86_OSproc.h"
-#include "xf86_ansic.h"
 
 #include "mipointer.h"
 #include "mibstore.h"
@@ -18,6 +18,7 @@
 #include "colormapst.h"
 #include "xf86cmap.h"
 #include "shadow.h"
+#include "shadowfb.h"
 
 /* for visuals */
 #include "fb.h"
@@ -77,14 +78,14 @@
  */
 static int pix24bpp = 0;
 
-#define VERSION                        4000
+#define IVTVDEV_VERSION                        4000
 #define IVTVDEV_NAME           "IVTVDEV_TST"
 #define IVTVDEV_DRIVER_NAME    "ivtvdev"
 #define IVTVDEV_MAJOR_VERSION  0
 #define IVTVDEV_MINOR_VERSION  10
 
 DriverRec IVTVDEV = {
-       VERSION,
+       IVTVDEV_VERSION,
        IVTVDEV_DRIVER_NAME,
 #if 0
        "driver for linux framebuffer devices",
@@ -108,6 +109,11 @@
 
 /* -------------------------------------------------------------------- */
 
+const char *IVTVDevshadowFBSymbols[] = {
+    "ShadowFBInit",
+    NULL
+};
+
 static const char *fbSymbols[] = {
        "fbScreenInit",
        "fbPictureInit",
@@ -116,11 +122,8 @@
 
 static const char *shadowSymbols[] = {
        "shadowAdd",
-       "shadowAlloc",
        "shadowInit",
        "shadowSetup",
-       "shadowUpdatePacked",
-       "shadowUpdateRotatePacked",
        NULL
 };
 
@@ -133,11 +136,11 @@
        MODULEVENDORSTRING,
        MODINFOSTRING1,
        MODINFOSTRING2,
-       XF86_VERSION_CURRENT,
+       XORG_VERSION_CURRENT,
        IVTVDEV_MAJOR_VERSION, IVTVDEV_MINOR_VERSION, 6,
        ABI_CLASS_VIDEODRV,
        ABI_VIDEODRV_VERSION,
-       NULL,
+       MOD_CLASS_VIDEODRV,
        {0, 0, 0, 0}
 };
 
@@ -150,7 +153,8 @@
        if (!setupDone) {
                setupDone = TRUE;
                xf86AddDriver(&IVTVDEV, module, 0);
-               LoaderRefSymLists(fbSymbols, shadowSymbols, NULL);
+               LoaderRefSymLists(fbSymbols, shadowSymbols,
+                                 IVTVDevshadowFBSymbols, NULL);
                return (pointer) 1;
        } else {
                if (errmaj)
@@ -189,6 +193,29 @@
        ivtvHWSendDMA(pScrn, fPtr->shadowmem, x1, x2, y1, y2);
 }
 
+void
+IVTVDevRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox)
+{
+       IVTVDevPtr fPtr = IVTVDEVPTR(pScrn);
+       int x1 = pScrn->virtualX;
+       int x2 = 0;
+       int y1 = pScrn->virtualY;
+       int y2 = 0;
+       while (num--) {
+               if (pbox->x1 < x1)
+                       x1 = pbox->x1;
+               if (pbox->x2 > x2)
+                       x2 = pbox->x2;
+               if (pbox->y1 < y1)
+                       y1 = pbox->y1;
+               if (pbox->y2 > y2)
+                       y2 = pbox->y2;
+               pbox++;
+       };
+
+       ivtvHWSendDMA(pScrn, fPtr->shadowmem, x1, x2, y1, y2);
+}
+
 static Bool IVTVDevGetRec(ScrnInfoPtr pScrn)
 {
        if (pScrn->driverPrivate != NULL)
@@ -221,10 +248,8 @@
 static Bool IVTVDevProbe(DriverPtr drv, int flags)
 {
        int i;
-       ScrnInfoPtr pScrn;
        GDevPtr *devSections;
        int numDevSections;
-       int bus, device, func;
        char *dev;
        Bool foundScreen = FALSE;
        int *usedChips;
@@ -258,7 +283,6 @@
        } else {
                for (i = 0; i < numUsed; i++) {
                        ScrnInfoPtr pScrn = xf86AllocateScreen(drv, 0);
-                       EntityInfoPtr pEnt;
                        dev =
                            xf86FindOptionValue(devSections[i]->options,
                                                "fbdev");
@@ -275,7 +299,7 @@
                                if (pScrn) {
                                        foundScreen = TRUE;
 
-                                       pScrn->driverVersion = VERSION;
+                                       pScrn->driverVersion = IVTVDEV_VERSION;
                                        pScrn->driverName = IVTVDEV_DRIVER_NAME;
                                        pScrn->name = IVTVDEV_NAME;
                                        pScrn->Probe = IVTVDevProbe;
@@ -437,9 +461,16 @@
                xf86LoaderReqSymLists(syms, NULL);
        }
 
+       xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "loading shadowfb");
+       if (!xf86LoadSubModule(pScrn, "shadowfb")) {
+               xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+                          "Couldn't load shadowfb module:\n");
+               return FALSE;
+       }
+       xf86LoaderReqSymLists(IVTVDevshadowFBSymbols, NULL);
+
        /* Load shadow */
-       xf86DrvMsg(pScrn->scrnIndex, X_CONFIG,
-                  "Using \"Shadow Framebuffer\"\n");
+       xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Using \"Shadow 
Framebuffer\"\n");
        if (!xf86LoadSubModule(pScrn, "shadow")) {
                IVTVDevFreeRec(pScrn);
                return FALSE;
@@ -458,7 +489,6 @@
        ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
        IVTVDevPtr fPtr = IVTVDEVPTR(pScrn);
        VisualPtr visual;
-       int init_picture = 0;
        int ret, flags, width, height;
 
        TRACE_ENTER("IVTVDevScreenInit");
@@ -517,7 +547,6 @@
        ret = fbScreenInit(pScreen, fPtr->shadowmem, width, height,
                           pScrn->xDpi, pScrn->yDpi, pScrn->displayWidth,
                           pScrn->bitsPerPixel);
-       init_picture = 1;
 
        if (!ret)
                return FALSE;
@@ -538,13 +567,11 @@
        }
 
        /* must be after RGB ordering fixed */
-       if (init_picture && !fbPictureInit(pScreen, NULL, 0))
+       if (!fbPictureInit(pScreen, NULL, 0))
                xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
                           "RENDER extension initialisation failed.\n");
 
-       if (!shadowSetup(pScreen) || !shadowAdd(pScreen, NULL,
-                                               FBshadowUpdatePacked,
-                                               NULL, 0, NULL)) {
+       if (!shadowInit(pScreen, FBshadowUpdatePacked, NULL)) {
                xf86DrvMsg(scrnIndex, X_ERROR,
                           "Shadow framebuffer initialization failed.\n");
                return FALSE;
@@ -564,6 +591,8 @@
        /* software cursor */
        miDCInitialize(pScreen, xf86GetPointerScreenFuncs());
 
+       ShadowFBInit(pScreen, IVTVDevRefreshArea);
+
        /* XXX It would be simpler to use miCreateDefColormap() in all cases. */
        if (!miCreateDefColormap(pScreen))
                return FALSE;

Index: 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtv_xv.c
===================================================================
--- 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtv_xv.c
   2005-08-30 22:24:04.000000000 +0200
+++ 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtv_xv.c
   2005-08-30 22:24:04.000000000 +0200
@@ -41,6 +41,13 @@
 /*
  * I N C L U D E S
  */
+#include <errno.h>
+#include <fcntl.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <sys/ioctl.h>
+
 #include "ivtvhw.h"
 #include "ivtvdev.h"
 
@@ -77,7 +84,7 @@
                              unsigned int *, unsigned int *, pointer);
 static int IVTVPutImage(ScrnInfoPtr, short, short, short, short, short,
                        short, short, short, int, unsigned char *, short,
-                       short, Bool, RegionPtr, pointer);
+                       short, Bool, RegionPtr, pointer, DrawablePtr);
 static int IVTVQueryImageAttributes(ScrnInfoPtr, int, unsigned short *,
                                    unsigned short *, int *, int *);
 
@@ -88,6 +95,11 @@
        XF86VideoAdaptorPtr newAdaptor = NULL;
        int num_adaptors;
        ivtvHWPtr fPtr = FBDEVHWPTR(pScrn);
+
+       ErrorF("Here I am with fPtr %p\n", fPtr);
+       xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                  "and YUV dev name %p\n", fPtr->yuvDevName);
+
        if (!fPtr->yuvDevName)
                return;
 
@@ -166,7 +178,6 @@
 IVTVSetPortAttributeOverlay(ScrnInfoPtr pScrn,
                            Atom attribute, INT32 value, pointer data)
 {
-       IVTVDevPtr devPtr = IVTVDEVPTR(pScrn);
         Ivtv_Xv_PortData *pPriv = (Ivtv_Xv_PortData *)data;
 #ifdef JOHN
        if (attribute == xvBrightness) {
@@ -210,7 +221,6 @@
 IVTVGetPortAttributeOverlay(ScrnInfoPtr pScrn,
                            Atom attribute, INT32 * value, pointer data)
 {
-       IVTVDevPtr devPtr = IVTVDEVPTR(pScrn);
         Ivtv_Xv_PortData *pPriv = (Ivtv_Xv_PortData *)data;
 
 #ifdef JOHN
@@ -251,7 +261,6 @@
        ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
        XF86VideoAdaptorPtr adapt;
        DevUnion *pPriv;
-       IVTVDevPtr devPtr = IVTVDEVPTR(pScrn);
        int i;
 
        if (!(adapt = xf86XVAllocateVideoAdaptorRec(pScrn)))
@@ -290,9 +299,8 @@
 
 static XF86VideoAdaptorPtr IVTVSetupImageVideoOverlay(ScreenPtr pScreen)
 {
-       ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
 #ifdef JOHN
-       IVTVPtr ps3v = IVTVPTR(pScrn);
+       ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
 #endif
        XF86VideoAdaptorPtr adapt;
        adapt = IVTVAllocAdaptor(pScreen);
@@ -452,8 +460,6 @@
 
        if (shutdown) {
                if (fPtr->fd_yuv != -1) {
-                        IVTVDevPtr devPtr = IVTVDEVPTR(pScrn);
-                       struct ivtvfb_ioctl_state_info state;
                        close(fPtr->fd_yuv);
                        fPtr->fd_yuv = -1;
                         struct ivtvfb_ioctl_colorkey colorKey;
@@ -476,7 +482,6 @@
        unsigned char *dst_2;
        unsigned int h_tail, w_tail;
        unsigned int h_size, w_size;
-       unsigned int h_lead, w_lead;
 
        // Always round the origin, but compensate by increasing the size
        if (src_x & 15) {
@@ -525,8 +530,7 @@
        unsigned int x, y, i, f;
        unsigned char *dst_2;
        unsigned int h_tail, w_tail;
-       unsigned int h_size, w_size;
-       unsigned int h_lead, w_lead;
+       unsigned int h_size;
 
        // The uv plane is half the size of the y plane, so 'correct' all 
dimensions.
        w /= 2;
@@ -603,7 +607,7 @@
        }
 }
 
-static char outbuf[622080];
+static unsigned char outbuf[622080];
 
 static int
 IVTVPutImage(ScrnInfoPtr pScrn,
@@ -613,7 +617,7 @@
             short drw_w, short drw_h,
             int id, unsigned char *buf,
             short width, short height,
-            Bool sync, RegionPtr clipBoxes, pointer data)
+            Bool sync, RegionPtr clipBoxes, pointer data, DrawablePtr pDraw)
 {
        ivtvHWPtr fPtr = FBDEVHWPTR(pScrn);
         Ivtv_Xv_PortData *pPriv = (Ivtv_Xv_PortData *)data;
@@ -641,6 +645,8 @@
        INT32 x1, x2, y1, y2;
        unsigned char *dst_start;
        int top, left, npixels, nlines;
+       int pitch, dstPitch;
+       int new_h;
 
        BoxRec dstBox;
        CARD32 tmp;
@@ -696,7 +702,6 @@
                        args.src_h = src_h;
                         args.dst_h = drw_h;
                         args.srcBuf_height = height;
-                       args.yuv_type = IVTV_YUV_TYPE_HME12;
                }
                break;
        default:

Index: 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvhw.c
===================================================================
--- 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvhw.c
    2005-06-12 23:03:21.000000000 +0200
+++ 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvhw.c
    2005-06-12 23:03:21.000000000 +0200
@@ -1,11 +1,18 @@
 /* $XFree86: xc/programs/Xserver/hw/xfree86/ivtvhw/ivtvhw.c,v 1.30 2002/11/25 
14:05:00 eich Exp $ */
+#include <errno.h>
+#include <fcntl.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/ioctl.h>
+
 
 #include "ivtvhw.h"
 
 /* all driver need this */
 #include "xf86.h"
 #include "xf86_OSproc.h"
-#include "xf86_ansic.h"
 
 /* pci stuff */
 #include "xf86PciInfo.h"
@@ -43,7 +50,7 @@
        0, 0, 2,
        ABI_CLASS_VIDEODRV,
        ABI_VIDEODRV_VERSION,
-       MOD_CLASS_NONE,
+       MOD_CLASS_VIDEODRV,
        {0, 0, 0, 0}
 };
 
@@ -667,8 +674,12 @@
 
 void ivtvHWAdjustFrame(int scrnIndex, int x, int y, int flags)
 {
+#if defined(JOHN) || DEBUG
        ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
+#endif
+#ifdef JOHN
        ivtvHWPtr fPtr = FBDEVHWPTR(pScrn);
+#endif
 
        TRACE_ENTER("AdjustFrame");
 #ifdef JOHN
@@ -701,7 +712,9 @@
 
 void ivtvHWDPMSSet(ScrnInfoPtr pScrn, int mode, int flags)
 {
+#ifdef JOHN
        ivtvHWPtr fPtr = FBDEVHWPTR(pScrn);
+#endif
        unsigned long fbmode;
 
        if (!pScrn->vtSema)
@@ -733,16 +746,16 @@
 
 Bool ivtvHWSaveScreen(ScreenPtr pScreen, int mode)
 {
+#ifdef JOHN
        ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum];
        ivtvHWPtr fPtr = FBDEVHWPTR(pScrn);
-       unsigned long unblank;
+       int unblank;
 
        if (!pScrn->vtSema)
                return TRUE;
 
        unblank = xf86IsUnblank(mode);
 
-#ifdef JOHN
        if (-1 == ioctl(fPtr->fd, FBIOBLANK, (void *)(1 - unblank))) {
                xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                           "FBIOBLANK: %s\n", strerror(errno));

Index: 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvhw.h
===================================================================
--- 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvhw.h
    2005-05-15 21:39:36.000000000 +0200
+++ 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/ivtvhw.h
    2005-05-15 21:39:36.000000000 +0200
@@ -6,6 +6,7 @@
 #include "colormapst.h"
 #include <asm/ioctl.h>
 #undef __STRICT_ANSI__
+#include <asm/types.h>
 #include <inttypes.h>
 #include <linux/ivtv.h>
 
@@ -14,6 +15,7 @@
 #define FBDEVHW_INTERLEAVED_PLANES     2       /* Interleaved planes   */
 #define FBDEVHW_TEXT                   3       /* Text/attributes      */
 #define FBDEVHW_VGA_PLANES             4       /* EGA/VGA planes       */
+#define IVTV_YUV_TYPE_HME12           0       /* Hauppauge macro block format 
*/
 #include "fbpriv.h"
 typedef struct {
        /* framebuffer device: filename (/dev/fb*), handle, more */

Index: 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/Imakefile
===================================================================
--- 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/Imakefile
   2005-08-25 21:39:55.000000000 +0200
+++ 
ivtv_xdriver_0.10.6/ivtvdrv/xc/programs/Xserver/hw/xfree86/drivers/ivtv/Imakefile
   2005-08-25 21:39:55.000000000 +0200
@@ -21,6 +21,10 @@
            -I$(XF86SRC)/rac \
            -I$(SERVERSRC)/Xext -I$(XF86SRC)/xf24_32bpp\
            -I$(FONTINCSRC) -I$(SERVERSRC)/include -I$(XINCLUDESRC) \
+          -I/usr/include \
+          -I/usr/include/xorg \
+          -I/usr/include/X11 \
+          -I/usr/include/X11/extensions \
           -I$(SERVERSRC)/miext/shadow -I$(EXTINCSRC) -I$(SERVERSRC)/render
 #endif
 #ifdef XF86_VERSION_CURRENT
_______________________________________________
ivtv-devel mailing list
ivtv-devel@ivtvdriver.org
http://ivtvdriver.org/mailman/listinfo/ivtv-devel

Reply via email to