Skip to contentSkip to conversation

avoid build fail without COMPOSITE

PATCH In review Ilia Mirkin 3 participants 6 messages Jul 14, 2015 – Jul 18, 2015 4 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 avoid build fail without COMPOSITE

---
 src/nouveau_dri2.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
src/nouveau_dri2.c +10 -5
index f22e319..4398559 100644
@@ -142,6 +142,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
 	NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
 	RegionPtr pCopyClip;
 	GCPtr pGC;
+	PixmapPtr pPix;
 	DrawablePtr src_draw, dst_draw;
 	Bool translate = FALSE;
 	int off_x = 0, off_y = 0;
@@ -170,9 +171,13 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
 	}
 
 	if (translate && pDraw->type == DRAWABLE_WINDOW) {
-		PixmapPtr pPix = get_drawable_pixmap(pDraw);
-		off_x = pDraw->x - pPix->screen_x;
-		off_y = pDraw->y - pPix->screen_y;
+		off_x = pDraw->x;
+		off_y = pDraw->y;
+#ifdef COMPOSITE
+		pPix = get_drawable_pixmap(pDraw);
+		off_x -= pPix->screen_x;
+		off_y -= pPix->screen_y;
+#endif
 	}
 
 	pGC = GetScratchGC(pDraw->depth, pScreen);
@@ -194,8 +199,8 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
 		if (extents->x1 == 0 && extents->y1 == 0 &&
 		    extents->x2 == pDraw->width &&
 		    extents->y2 == pDraw->height) {
-			PixmapPtr fpix = get_drawable_pixmap(dst_draw);
-			struct nouveau_bo *bo = nouveau_pixmap_bo(fpix);
+			pPix = get_drawable_pixmap(dst_draw);
+			struct nouveau_bo *bo = nouveau_pixmap_bo(pPix);
 			if (bo)
 				nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client);
 		}
Signature · 6 lines
2.3.6

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 1436908642-20721-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/[email protected]

#2 lore raw

Lgtm! You can add my R-b if you want!

Quoted 34 lines · Ilia Mirkin
---
  src/nouveau_dri2.c | 15 ++++++++++-----
  1 file changed, 10 insertions(+), 5 deletions(-)
src/nouveau_dri2.c +8 -3
index f22e319..4398559 100644
@@ -142,6 +142,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
  	NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
  	RegionPtr pCopyClip;
  	GCPtr pGC;
+	PixmapPtr pPix;
  	DrawablePtr src_draw, dst_draw;
  	Bool translate = FALSE;
  	int off_x = 0, off_y = 0;
@@ -170,9 +171,13 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
  	}
 
  	if (translate && pDraw->type == DRAWABLE_WINDOW) {
-		PixmapPtr pPix = get_drawable_pixmap(pDraw);
-		off_x = pDraw->x - pPix->screen_x;
-		off_y = pDraw->y - pPix->screen_y;
+		off_x = pDraw->x;
+		off_y = pDraw->y;
+#ifdef COMPOSITE
+		pPix = get_drawable_pixmap(pDraw);
+		off_x -= pPix->screen_x;
+		off_y -= pPix->screen_y;
+#endif
  	}
 
  	pGC = GetScratchGC(pDraw->depth, pScreen);

src/nouveau_dri2.c nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio · line 206

Quoted 10 lines
src/nouveau_dri2.c +2 -2
@@ -194,8 +199,8 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
  		if (extents->x1 == 0 && extents->y1 == 0 &&
  		    extents->x2 == pDraw->width &&
  		    extents->y2 == pDraw->height) {
-			PixmapPtr fpix = get_drawable_pixmap(dst_draw);
-			struct nouveau_bo *bo = nouveau_pixmap_bo(fpix);
+			pPix = get_drawable_pixmap(dst_draw);
+			struct nouveau_bo *bo = nouveau_pixmap_bo(pPix);
  			if (bo)
  				nouveau_bo_wait(bo, NOUVEAU_BO_RD, pNv->client);
  		}

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

#3 lore raw
In reply to a message not in the archive
Quoted 20 lines · Ilia Mirkin
---
 src/nouveau_dri2.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
src/nouveau_dri2.c +1 -0
index f22e319..4398559 100644
@@ -142,6 +142,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
        NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
        RegionPtr pCopyClip;
        GCPtr pGC;
+       PixmapPtr pPix;
        DrawablePtr src_draw, dst_draw;
        Bool translate = FALSE;
        int off_x = 0, off_y = 0;
@@ -170,9 +171,13 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
        }
 
        if (translate && pDraw->type == DRAWABLE_WINDOW) {

src/nouveau_dri2.c nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio · line 180

Quoted 10 lines
src/nouveau_dri2.c +7 -3
-               PixmapPtr pPix = get_drawable_pixmap(pDraw);
-               off_x = pDraw->x - pPix->screen_x;
-               off_y = pDraw->y - pPix->screen_y;
+               off_x = pDraw->x;
+               off_y = pDraw->y;
+#ifdef COMPOSITE
+               pPix = get_drawable_pixmap(pDraw);
+               off_x -= pPix->screen_x;
+               off_y -= pPix->screen_y;
+#endif

If I understand things correctly both ati and the intel ddx seems set the offsets to zero when composite is missing.
I doubt that many people build xserver without it though :-)

-Emil
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): CACvgo52=umZCKu-wk7nJovVMb-N7iy8JtSx5LcZpguGhPrPz5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#5 lore raw

Well, I don't pretend to know anything about X, but this is the commit that added the code in question:

commit 297fd0d0755bda698be1d0b30cc60a41d7673c0b

Author: Dave Airlie <[email protected]>
Date:   Tue Oct 16 16:15:16 2012 +1000

nouveau/dri2: fix pixmap/window offset calcs.

This should fix prime rendering under kwin, and not break it under the others.

src/nouveau_dri2.c +0 -0
index 71cff26..7bd0b3a 100644
@@ -165,9 +165,9 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen,

DrawablePtr pDraw, RegionPtr pRegio

                translate = TRUE;

        if (translate && pDraw->type == DRAWABLE_WINDOW) {
-               WindowPtr pWin = (WindowPtr)pDraw;
-               off_x = pWin->origin.x;
-               off_y = pWin->origin.y;
+               PixmapPtr pPix = get_drawable_pixmap(pDraw);
+               off_x = pDraw->x - pPix->screen_x;
+               off_y = pDraw->y - pPix->screen_y;
        }

        pGC = GetScratchGC(pDraw->depth, pScreen);

Now I sort of assume that pDraw->x == pWin->origin.x. But... who knows.

-ilia

Quoted 35 lines · Emil Velikov
Quoted 20 lines · Ilia Mirkin
---
 src/nouveau_dri2.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
src/nouveau_dri2.c +1 -0
index f22e319..4398559 100644
@@ -142,6 +142,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
        NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
        RegionPtr pCopyClip;
        GCPtr pGC;
+       PixmapPtr pPix;
        DrawablePtr src_draw, dst_draw;
        Bool translate = FALSE;
        int off_x = 0, off_y = 0;
@@ -170,9 +171,13 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
        }
 
        if (translate && pDraw->type == DRAWABLE_WINDOW) {

src/nouveau_dri2.c nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio · line 180

Quoted 10 lines
src/nouveau_dri2.c +7 -3
-               PixmapPtr pPix = get_drawable_pixmap(pDraw);
-               off_x = pDraw->x - pPix->screen_x;
-               off_y = pDraw->y - pPix->screen_y;
+               off_x = pDraw->x;
+               off_y = pDraw->y;
+#ifdef COMPOSITE
+               pPix = get_drawable_pixmap(pDraw);
+               off_x -= pPix->screen_x;
+               off_y -= pPix->screen_y;
+#endif

If I understand things correctly both ati and the intel ddx seems set the offsets to zero when composite is missing.
I doubt that many people build xserver without it though :-)

Quoted 1 line

-Emil

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): CAKb7UvjPT3QE9mBHZr3GcKc_s_FdU53sjHLwaqrn=hOX8xK_eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#7 lore raw

Upon closer look it seem that I was a bit off - the ati/intel ddx does not set off_x/y to zero when built without composite*.

... in copy_region2, they do so when working with video - XvAdaptorPtr::ddPutImage/XF86VideoAdaptorPtr::PutImage.

Does this mean that they need a similar update ? What are the symptoms of the issue ?

Thanks
Emil

Quoted 34 lines · Ilia Mirkin

Well, I don't pretend to know anything about X, but this is the commit that added the code in question:

commit 297fd0d0755bda698be1d0b30cc60a41d7673c0b

Author: Dave Airlie <[email protected]>
Date:   Tue Oct 16 16:15:16 2012 +1000

nouveau/dri2: fix pixmap/window offset calcs.

This should fix prime rendering under kwin, and not break it under the others.

src/nouveau_dri2.c +0 -0
index 71cff26..7bd0b3a 100644
@@ -165,9 +165,9 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen,

DrawablePtr pDraw, RegionPtr pRegio

                translate = TRUE;

        if (translate && pDraw->type == DRAWABLE_WINDOW) {
src/nouveau_dri2.c +3 -3
-               WindowPtr pWin = (WindowPtr)pDraw;
-               off_x = pWin->origin.x;
-               off_y = pWin->origin.y;
+               PixmapPtr pPix = get_drawable_pixmap(pDraw);
+               off_x = pDraw->x - pPix->screen_x;
+               off_y = pDraw->y - pPix->screen_y;
        }
 
        pGC = GetScratchGC(pDraw->depth, pScreen);
Quoted 42 lines

Now I sort of assume that pDraw->x == pWin->origin.x. But... who knows.

-ilia

Quoted 36 lines · Emil Velikov
Quoted 20 lines · Ilia Mirkin
---
 src/nouveau_dri2.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)
src/nouveau_dri2.c +1 -0
index f22e319..4398559 100644
@@ -142,6 +142,7 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
        NVPtr pNv = NVPTR(xf86ScreenToScrn(pScreen));
        RegionPtr pCopyClip;
        GCPtr pGC;
+       PixmapPtr pPix;
        DrawablePtr src_draw, dst_draw;
        Bool translate = FALSE;
        int off_x = 0, off_y = 0;
@@ -170,9 +171,13 @@ nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio
        }
 
        if (translate && pDraw->type == DRAWABLE_WINDOW) {

src/nouveau_dri2.c nouveau_dri2_copy_region2(ScreenPtr pScreen, DrawablePtr pDraw, RegionPtr pRegio · line 180

Quoted 10 lines
src/nouveau_dri2.c +7 -3
-               PixmapPtr pPix = get_drawable_pixmap(pDraw);
-               off_x = pDraw->x - pPix->screen_x;
-               off_y = pDraw->y - pPix->screen_y;
+               off_x = pDraw->x;
+               off_y = pDraw->y;
+#ifdef COMPOSITE
+               pPix = get_drawable_pixmap(pDraw);
+               off_x -= pPix->screen_x;
+               off_y -= pPix->screen_y;
+#endif

If I understand things correctly both ati and the intel ddx seems set the offsets to zero when composite is missing.
I doubt that many people build xserver without it though :-)

-Emil

_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): CACvgo500K-66hEN0OKNioy7s-WaTRM81LvAqQyFmXxN5E1cqhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#9 lore raw
Quoted 9 lines · Emil Velikov

Upon closer look it seem that I was a bit off - the ati/intel ddx does not set off_x/y to zero when built without composite*.

... in copy_region2, they do so when working with video - XvAdaptorPtr::ddPutImage/XF86VideoAdaptorPtr::PutImage.

Does this mean that they need a similar update ? What are the symptoms of the issue ?

Can anyone give some rough pointers to the appropriate reading material ? As mentioned neither ati nor the intel ddx follow this approach so I'm a bit puzzled. From a quick test there is no "build fail" if when COMPOSITE is missing. Am I missing something obvious/trivial ?

Thanks
Emil
_______________________________________________
Nouveau mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau