* [PATCH] avoid build fail without COMPOSITE
@ 2015-07-14 21:17 Ilia Mirkin
[not found] ` <1436908642-20721-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Ilia Mirkin @ 2015-07-14 21:17 UTC (permalink / raw)
To: nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, bskeggs-H+wXaHxf7aLQT0dZR+AlfA
---
src/nouveau_dri2.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index f22e319..4398559 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -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);
}
--
2.3.6
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] avoid build fail without COMPOSITE
[not found] ` <1436908642-20721-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
@ 2015-07-14 21:27 ` Tobias Klausmann
2015-07-14 21:46 ` Emil Velikov
1 sibling, 0 replies; 6+ messages in thread
From: Tobias Klausmann @ 2015-07-14 21:27 UTC (permalink / raw)
To: Ilia Mirkin, nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
bskeggs-H+wXaHxf7aLQT0dZR+AlfA
Lgtm! You can add my R-b if you want!
On 14.07.2015 23:17, Ilia Mirkin wrote:
> ---
> src/nouveau_dri2.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
> index f22e319..4398559 100644
> --- a/src/nouveau_dri2.c
> +++ b/src/nouveau_dri2.c
> @@ -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);
> }
_______________________________________________
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] avoid build fail without COMPOSITE
[not found] ` <1436908642-20721-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-07-14 21:27 ` Tobias Klausmann
@ 2015-07-14 21:46 ` Emil Velikov
[not found] ` <CACvgo52=umZCKu-wk7nJovVMb-N7iy8JtSx5LcZpguGhPrPz5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
1 sibling, 1 reply; 6+ messages in thread
From: Emil Velikov @ 2015-07-14 21:46 UTC (permalink / raw)
To: Ilia Mirkin; +Cc: ML nouveau, Ben Skeggs
On 14 July 2015 at 22:17, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> ---
> src/nouveau_dri2.c | 15 ++++++++++-----
> 1 file changed, 10 insertions(+), 5 deletions(-)
>
> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
> index f22e319..4398559 100644
> --- a/src/nouveau_dri2.c
> +++ b/src/nouveau_dri2.c
> @@ -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
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
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] avoid build fail without COMPOSITE
[not found] ` <CACvgo52=umZCKu-wk7nJovVMb-N7iy8JtSx5LcZpguGhPrPz5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-07-14 22:51 ` Ilia Mirkin
[not found] ` <CAKb7UvjPT3QE9mBHZr3GcKc_s_FdU53sjHLwaqrn=hOX8xK_eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Ilia Mirkin @ 2015-07-14 22:51 UTC (permalink / raw)
To: Emil Velikov; +Cc: ML nouveau, Ben Skeggs
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 <airlied@redhat.com>
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.
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
index 71cff26..7bd0b3a 100644
--- a/src/nouveau_dri2.c
+++ b/src/nouveau_dri2.c
@@ -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
On Tue, Jul 14, 2015 at 5:46 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> On 14 July 2015 at 22:17, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>> ---
>> src/nouveau_dri2.c | 15 ++++++++++-----
>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>
>> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
>> index f22e319..4398559 100644
>> --- a/src/nouveau_dri2.c
>> +++ b/src/nouveau_dri2.c
>> @@ -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
> 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
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] avoid build fail without COMPOSITE
[not found] ` <CAKb7UvjPT3QE9mBHZr3GcKc_s_FdU53sjHLwaqrn=hOX8xK_eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-07-15 13:12 ` Emil Velikov
[not found] ` <CACvgo500K-66hEN0OKNioy7s-WaTRM81LvAqQyFmXxN5E1cqhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Emil Velikov @ 2015-07-15 13:12 UTC (permalink / raw)
To: Ilia Mirkin; +Cc: ML nouveau, Ben Skeggs
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
On 14 July 2015 at 23:51, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
> 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 <airlied@redhat.com>
> 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.
>
> Signed-off-by: Dave Airlie <airlied@redhat.com>
>
> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
> index 71cff26..7bd0b3a 100644
> --- a/src/nouveau_dri2.c
> +++ b/src/nouveau_dri2.c
> @@ -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
>
>
> On Tue, Jul 14, 2015 at 5:46 PM, Emil Velikov <emil.l.velikov@gmail.com> wrote:
>> On 14 July 2015 at 22:17, Ilia Mirkin <imirkin@alum.mit.edu> wrote:
>>> ---
>>> src/nouveau_dri2.c | 15 ++++++++++-----
>>> 1 file changed, 10 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/src/nouveau_dri2.c b/src/nouveau_dri2.c
>>> index f22e319..4398559 100644
>>> --- a/src/nouveau_dri2.c
>>> +++ b/src/nouveau_dri2.c
>>> @@ -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
>> 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
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] avoid build fail without COMPOSITE
[not found] ` <CACvgo500K-66hEN0OKNioy7s-WaTRM81LvAqQyFmXxN5E1cqhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2015-07-18 14:42 ` Emil Velikov
0 siblings, 0 replies; 6+ messages in thread
From: Emil Velikov @ 2015-07-18 14:42 UTC (permalink / raw)
To: Ilia Mirkin; +Cc: ML nouveau, Ben Skeggs
On 15 July 2015 at 14:12, Emil Velikov <emil.l.velikov@gmail.com> wrote:
> 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
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-07-18 14:42 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-07-14 21:17 [PATCH] avoid build fail without COMPOSITE Ilia Mirkin
[not found] ` <1436908642-20721-1-git-send-email-imirkin-FrUbXkNCsVf2fBVCVOL8/A@public.gmane.org>
2015-07-14 21:27 ` Tobias Klausmann
2015-07-14 21:46 ` Emil Velikov
[not found] ` <CACvgo52=umZCKu-wk7nJovVMb-N7iy8JtSx5LcZpguGhPrPz5g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-14 22:51 ` Ilia Mirkin
[not found] ` <CAKb7UvjPT3QE9mBHZr3GcKc_s_FdU53sjHLwaqrn=hOX8xK_eQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-15 13:12 ` Emil Velikov
[not found] ` <CACvgo500K-66hEN0OKNioy7s-WaTRM81LvAqQyFmXxN5E1cqhA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-07-18 14:42 ` Emil Velikov
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.