tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Alternative intel driver



christos%zoulas.com@localhost (Christos Zoulas) wrote:
>On May 13,  3:43pm, rjs%fdy2.co.uk@localhost (Robert Swindells) wrote:
>-- Subject: Re: Alternative intel driver
>
>| 
>| Christos Zoulas wrote:
>| >In article <20150513075157.125FD30285B%ren.fdy2.co.uk@localhost>,
>| >Robert Swindells  <rjs%fdy2.co.uk@localhost> wrote:
>| >>
>| >>I have local patches that allow the final version of the intel driver
>| >>with support for UMS to be built against the xorg server that is in
>| >>current.
>| >>
>| >>The netbook of mine that wouldn't work with KMS seems fine now.
>| >>
>| >>Is it still worthwhile importing it into the tree ?
>| >>
>| >>It could help with PR 49330 I guess.
>| >
>| >Append the patches to that PR?
>| 
>| Any patches would mostly be against files that are not in CVS, the
>| rest would be the build infrastructure stuff which is all working.
>| 
>| I don't really see the point of dumping work on somebody else by
>| putting it in a PR, the question is whether we want it or not.
>
>I think we want it, but can we get it code-reviewed somehow first?

Ok, driver diffs are below, they are against 2.9.1.

I will do the makefile ones later.

diff -u -r xf86-video-intel-old/dist/src/i830_uxa.c xf86-video-intel-old-rjs/dist/src/i830_uxa.c
--- xf86-video-intel-old/dist/src/i830_uxa.c	2009-10-26 11:48:05.000000000 +0000
+++ xf86-video-intel-old-rjs/dist/src/i830_uxa.c	2015-03-20 12:29:05.000000000 +0000
@@ -79,7 +79,7 @@
     ROP_1
 };
 
-static int uxa_pixmap_index;
+static DevPrivateKeyRec uxa_pixmap_index;
 
 /**
  * Returns whether a given pixmap is tiled or not.
@@ -452,7 +452,11 @@
 dri_bo *
 i830_get_pixmap_bo(PixmapPtr pixmap)
 {
+#if HAS_DEVPRIVATEKEYREC
+    return dixGetPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
+#else
     return dixLookupPrivate(&pixmap->devPrivates, &uxa_pixmap_index);
+#endif
 }
 
 void
@@ -703,8 +707,12 @@
     ScrnInfoPtr scrn = xf86Screens[pScreen->myNum];
     I830Ptr i830 = I830PTR(scrn);
 
+#if HAS_DIXREGISTERPRIVATEKEY
+    if (!dixRegisterPrivateKey(&uxa_pixmap_index, PRIVATE_PIXMAP, 0))
+#else
     if (!dixRequestPrivate(&uxa_pixmap_index, 0))
-	return FALSE;
+#endif
+	    return FALSE;
 
     i830->uxa_driver = uxa_driver_alloc();
     if (i830->uxa_driver == NULL)
diff -u -r xf86-video-intel-old/dist/src/i830_video.c xf86-video-intel-old-rjs/dist/src/i830_video.c
--- xf86-video-intel-old/dist/src/i830_video.c	2009-10-26 11:48:05.000000000 +0000
+++ xf86-video-intel-old-rjs/dist/src/i830_video.c	2015-05-13 16:56:25.000000000 +0100
@@ -2204,40 +2204,6 @@
     return ret;
 }
 
-static void
-i830_fill_colorkey (ScreenPtr pScreen, uint32_t key, RegionPtr clipboxes)
-{
-   DrawablePtr root = &WindowTable[pScreen->myNum]->drawable;
-   XID	       pval[2];
-   BoxPtr      pbox = REGION_RECTS(clipboxes);
-   int	       i, nbox = REGION_NUM_RECTS(clipboxes);
-   xRectangle  *rects;
-   GCPtr       gc;
-
-   if(!xf86Screens[pScreen->myNum]->vtSema) return;
-
-   gc = GetScratchGC(root->depth, pScreen);
-   pval[0] = key;
-   pval[1] = IncludeInferiors;
-   (void) ChangeGC(gc, GCForeground|GCSubwindowMode, pval);
-   ValidateGC(root, gc);
-
-   rects = xalloc (nbox * sizeof(xRectangle));
-
-   for(i = 0; i < nbox; i++, pbox++) 
-   {
-      rects[i].x = pbox->x1;
-      rects[i].y = pbox->y1;
-      rects[i].width = pbox->x2 - pbox->x1;
-      rects[i].height = pbox->y2 - pbox->y1;
-   }
-   
-   (*gc->ops->PolyFillRect)(root, gc, nbox, rects);
-   
-   xfree (rects);
-   FreeScratchGC (gc);
-}
-
 /*
  * The source rectangle of the video is defined by (src_x, src_y, src_w, src_h).
  * The dest rectangle of the video is defined by (drw_x, drw_y, drw_w, drw_h).
@@ -2525,7 +2491,7 @@
 	/* update cliplist */
 	if (!REGION_EQUAL(pScrn->pScreen, &pPriv->clip, clipBoxes)) {
 	    REGION_COPY(pScrn->pScreen, &pPriv->clip, clipBoxes);
-	    i830_fill_colorkey (pScreen, pPriv->colorKey, clipBoxes);
+	    xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes);
 	}
     } else {
         Bool sync = TRUE;
@@ -2867,7 +2833,7 @@
 		     surface->pitches[0], x1, y1, x2, y2, &dstBox,
 		     src_w, src_h, drw_w, drw_h);
 
-    i830_fill_colorkey (pScreen, pI830Priv->colorKey, clipBoxes);
+    xf86XVFillKeyHelper(pScrn->pScreen, pI830Priv->colorKey, clipBoxes);
 
     pPriv->isOn = TRUE;
     /* we've prempted the XvImage stream so set its free timer */
diff -u -r xf86-video-intel-old/dist/uxa/uxa-priv.h xf86-video-intel-old-rjs/dist/uxa/uxa-priv.h
--- xf86-video-intel-old/dist/uxa/uxa-priv.h	2009-10-26 11:48:05.000000000 +0000
+++ xf86-video-intel-old-rjs/dist/uxa/uxa-priv.h	2015-03-20 11:20:51.000000000 +0000
@@ -177,12 +177,16 @@
     (PixmapWidthPaddingInfo[d].padRoundUp+1)))
 #endif
 
-extern int uxa_screen_index;
+extern DevPrivateKeyRec uxa_screen_index;
 static inline uxa_screen_t *
 uxa_get_screen(ScreenPtr screen)
 {
+#if HAS_DEVPRIVATEKEYREC
+    return dixGetPrivate(&screen->devPrivates, &uxa_screen_index);
+#else
     return (uxa_screen_t *)dixLookupPrivate(&screen->devPrivates,
 					    &uxa_screen_index);
+#endif
 }
 
 /** Align an offset to an arbitrary alignment */
diff -u -r xf86-video-intel-old/dist/uxa/uxa-render.c xf86-video-intel-old-rjs/dist/uxa/uxa-render.c
--- xf86-video-intel-old/dist/uxa/uxa-render.c	2009-10-26 11:48:05.000000000 +0000
+++ xf86-video-intel-old-rjs/dist/uxa/uxa-render.c	2015-05-13 16:57:19.000000000 +0100
@@ -438,11 +438,13 @@
     return pPicture;
 }
 
+/*
 #if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC (1,6,99,1,0)
 #define IMAGE_FROM_PICT(P) image_from_pict(P, 0)
 #else
-#define IMAGE_FROM_PICT(P) image_from_pict(P, 0, 0)
-#endif
+*/
+#define IMAGE_FROM_PICT(P) image_from_pict(P, 0, 0, 0)
+/*#endif*/
 
 static PicturePtr
 uxa_acquire_pattern (ScreenPtr pScreen,
@@ -452,8 +454,9 @@
 		     CARD16 width, CARD16 height)
 {
     pixman_image_t *source, *image;
-
-    source = IMAGE_FROM_PICT (pPict);
+    int src_xoff, src_yoff;
+    
+    source = image_from_pict(pPict, FALSE, &src_xoff, &src_yoff);
     if (!source)
 	return 0;
 
diff -u -r xf86-video-intel-old/dist/uxa/uxa.c xf86-video-intel-old-rjs/dist/uxa/uxa.c
--- xf86-video-intel-old/dist/uxa/uxa.c	2009-10-26 11:48:05.000000000 +0000
+++ xf86-video-intel-old-rjs/dist/uxa/uxa.c	2015-03-20 11:21:26.000000000 +0000
@@ -39,7 +39,7 @@
 #include "dixfontstr.h"
 #include "uxa.h"
 
-int uxa_screen_index;
+DevPrivateKeyRec uxa_screen_index;
 
 /**
  * uxa_get_drawable_pixmap() returns a backing pixmap for a given drawable.
@@ -460,6 +460,10 @@
     ps = GetPictureScreenIfSet(screen);
 #endif
 
+#if HAS_DIXREGISTERPRIVATEKEY
+    if (!dixRegisterPrivateKey(&uxa_screen_index, PRIVATE_SCREEN, 0))
+	return FALSE;
+#endif
     uxa_screen = xcalloc (sizeof (uxa_screen_t), 1);
 
     if (!uxa_screen) {


Home | Main Index | Thread Index | Old Index