All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
@ 2011-05-01 21:59 Marcin Slusarz
  2011-05-02 12:44 ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Slusarz @ 2011-05-01 21:59 UTC (permalink / raw)
  To: mesa-dev; +Cc: nouveau

We need to distinguish surfaces for mouse cursors from scanouts, because nv50
hardware display engine ignores tiling flags.
i915 seems to have similar needs, so fix it too.
---
 src/gallium/drivers/i915/i915_resource_texture.c |    6 +-----
 src/gallium/drivers/nv50/nv50_miptree.c          |   11 +++++++++--
 src/gallium/include/pipe/p_defines.h             |    1 +
 src/gallium/state_trackers/xorg/xorg_crtc.c      |    1 +
 4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c
index 7816925..7ad191b 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -826,11 +826,7 @@ i915_texture_create(struct pipe_screen *screen,
    }
 
    /* for scanouts and cursors, cursors arn't scanouts */
-
-   /* XXX: use a custom flag for cursors, don't rely on magically
-    * guessing that this is Xorg asking for a cursor
-    */
-   if ((template->bind & PIPE_BIND_SCANOUT) && template->width0 != 64)
+   if ((template->bind & PIPE_BIND_SCANOUT) && !(template->bind & PIPE_BIND_CURSOR))
       buf_usage = I915_NEW_SCANOUT;
    else
       buf_usage = I915_NEW_TEXTURE;
diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c
index 9eeca05..d632e21 100644
--- a/src/gallium/drivers/nv50/nv50_miptree.c
+++ b/src/gallium/drivers/nv50/nv50_miptree.c
@@ -158,7 +158,9 @@ nv50_miptree_create(struct pipe_screen *pscreen,
       tile_flags = 0x6000;
       break;
    default:
-      if ((pt->bind & PIPE_BIND_SCANOUT) &&
+      if (pt->bind & PIPE_BIND_CURSOR)
+         tile_flags = 0; /* PDISPLAY does not support tiling */
+      else if ((pt->bind & PIPE_BIND_SCANOUT) &&
           util_format_get_blocksizebits(pt->format) == 32)
          tile_flags = 0x7a00;
       else
@@ -176,7 +178,12 @@ nv50_miptree_create(struct pipe_screen *pscreen,
       unsigned blocksize = util_format_get_blocksize(pt->format);
 
       lvl->offset = mt->total_size;
-      lvl->tile_mode = get_tile_dims(nbx, nby, d);
+
+      if (tile_flags == 0)
+         lvl->tile_mode = 0;
+      else
+         lvl->tile_mode = get_tile_dims(nbx, nby, d);
+
       lvl->pitch = align(nbx * blocksize, NV50_TILE_PITCH(lvl->tile_mode));
 
       mt->total_size += lvl->pitch *
diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h
index 431a7fb..ae82baa 100644
--- a/src/gallium/include/pipe/p_defines.h
+++ b/src/gallium/include/pipe/p_defines.h
@@ -301,6 +301,7 @@ enum pipe_transfer_usage {
 #define PIPE_BIND_TRANSFER_READ        (1 << 10) /* get_transfer */
 #define PIPE_BIND_STREAM_OUTPUT        (1 << 11) /* set_stream_output_buffers */
 #define PIPE_BIND_CUSTOM               (1 << 16) /* state-tracker/winsys usages */
+#define PIPE_BIND_CURSOR               (1 << 17) /* mouse cursor */
 
 /* The first two flags above were previously part of the amorphous
  * TEXTURE_USAGE, most of which are now descriptions of the ways a
diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c
index d751ac1..8eaf414 100644
--- a/src/gallium/state_trackers/xorg/xorg_crtc.c
+++ b/src/gallium/state_trackers/xorg/xorg_crtc.c
@@ -218,6 +218,7 @@ crtc_load_cursor_argb_ga3d(xf86CrtcPtr crtc, CARD32 * image)
 	memset(&templat, 0, sizeof(templat));
 	templat.bind |= PIPE_BIND_RENDER_TARGET;
 	templat.bind |= PIPE_BIND_SCANOUT;
+	templat.bind |= PIPE_BIND_CURSOR;
 	templat.target = PIPE_TEXTURE_2D;
 	templat.last_level = 0;
 	templat.depth0 = 1;
-- 
1.7.4.1

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
  2011-05-01 21:59 [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR Marcin Slusarz
@ 2011-05-02 12:44 ` Daniel Vetter
  2011-05-02 12:56   ` Benjamin Franzke
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2011-05-02 12:44 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: mesa-dev, nouveau

On Sun, May 1, 2011 at 11:59 PM, Marcin Slusarz
<marcin.slusarz@gmail.com> wrote:
> We need to distinguish surfaces for mouse cursors from scanouts, because nv50
> hardware display engine ignores tiling flags.
> i915 seems to have similar needs, so fix it too.

For the i915g part:
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-- 
Daniel Vetter
daniel.vetter@ffwll.ch - +41 (0) 79 364 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
  2011-05-02 12:44 ` Daniel Vetter
@ 2011-05-02 12:56   ` Benjamin Franzke
       [not found]     ` <BANLkTikbYs7y2gCELyyi1OKcuZYYVCfieA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Benjamin Franzke @ 2011-05-02 12:56 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: mesa-dev, nouveau

I think in i915g the CURSOR flag should be used in i9x5_scanout_layout
for the "special case for cursors" as well, instead of only checking
only pt->width0 == 64 && pt->height0 == 64.

2011/5/2 Daniel Vetter <daniel@ffwll.ch>:
> On Sun, May 1, 2011 at 11:59 PM, Marcin Slusarz
> <marcin.slusarz@gmail.com> wrote:
>> We need to distinguish surfaces for mouse cursors from scanouts, because nv50
>> hardware display engine ignores tiling flags.
>> i915 seems to have similar needs, so fix it too.
>
> For the i915g part:
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> --
> Daniel Vetter
> daniel.vetter@ffwll.ch - +41 (0) 79 364 57 48 - http://blog.ffwll.ch
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Mesa-dev] [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
       [not found]     ` <BANLkTikbYs7y2gCELyyi1OKcuZYYVCfieA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
@ 2011-05-02 13:11       ` Daniel Vetter
  2011-05-02 18:40         ` Marcin Slusarz
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2011-05-02 13:11 UTC (permalink / raw)
  To: Benjamin Franzke
  Cc: mesa-dev-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
	nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW

On Mon, May 2, 2011 at 2:56 PM, Benjamin Franzke
<benjaminfranzke-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:
> I think in i915g the CURSOR flag should be used in i9x5_scanout_layout
> for the "special case for cursors" as well, instead of only checking
> only pt->width0 == 64 && pt->height0 == 64.

Oops, so much for actually re-checking the code. On the other hand, that
part is broken, it needs a
   tex->tiling = I915_TILE_NONE;
and perhaps some check that width == height == 64 indeed holds. Then
move it out as the first if clause and it'd start to make sense ...
-Daniel
-- 
Daniel Vetter
daniel.vetter-/w4YWyX8dFk@public.gmane.org - +41 (0) 79 364 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
  2011-05-02 13:11       ` [Mesa-dev] " Daniel Vetter
@ 2011-05-02 18:40         ` Marcin Slusarz
  2011-05-03 10:06           ` Daniel Vetter
  0 siblings, 1 reply; 7+ messages in thread
From: Marcin Slusarz @ 2011-05-02 18:40 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: mesa-dev, Benjamin Franzke, nouveau

On Mon, May 02, 2011 at 03:11:00PM +0200, Daniel Vetter wrote:
> On Mon, May 2, 2011 at 2:56 PM, Benjamin Franzke
> <benjaminfranzke@googlemail.com> wrote:
> > I think in i915g the CURSOR flag should be used in i9x5_scanout_layout
> > for the "special case for cursors" as well, instead of only checking
> > only pt->width0 == 64 && pt->height0 == 64.
> 
> Oops, so much for actually re-checking the code. On the other hand, that
> part is broken, it needs a
>    tex->tiling = I915_TILE_NONE;
> and perhaps some check that width == height == 64 indeed holds. Then
> move it out as the first if clause and it'd start to make sense ...

Could you fix it in separate patch?

I couldn't even test it...

Marcin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
  2011-05-02 18:40         ` Marcin Slusarz
@ 2011-05-03 10:06           ` Daniel Vetter
  2011-05-08 22:33             ` Marcin Slusarz
  0 siblings, 1 reply; 7+ messages in thread
From: Daniel Vetter @ 2011-05-03 10:06 UTC (permalink / raw)
  To: Marcin Slusarz; +Cc: mesa-dev, Benjamin Franzke, nouveau

On Mon, May 2, 2011 at 8:40 PM, Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
> On Mon, May 02, 2011 at 03:11:00PM +0200, Daniel Vetter wrote:
>> On Mon, May 2, 2011 at 2:56 PM, Benjamin Franzke
>> <benjaminfranzke@googlemail.com> wrote:
>> > I think in i915g the CURSOR flag should be used in i9x5_scanout_layout
>> > for the "special case for cursors" as well, instead of only checking
>> > only pt->width0 == 64 && pt->height0 == 64.
>>
>> Oops, so much for actually re-checking the code. On the other hand, that
>> part is broken, it needs a
>>    tex->tiling = I915_TILE_NONE;
>> and perhaps some check that width == height == 64 indeed holds. Then
>> move it out as the first if clause and it'd start to make sense ...
>
> Could you fix it in separate patch?

Jakob has said (on irc) that he intends to again play with xorg-i915g ...
-Daniel
-- 
Daniel Vetter
daniel.vetter@ffwll.ch - +41 (0) 79 364 57 48 - http://blog.ffwll.ch

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR
  2011-05-03 10:06           ` Daniel Vetter
@ 2011-05-08 22:33             ` Marcin Slusarz
  0 siblings, 0 replies; 7+ messages in thread
From: Marcin Slusarz @ 2011-05-08 22:33 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: mesa-dev, Benjamin Franzke, nouveau

On Tue, May 03, 2011 at 12:06:33PM +0200, Daniel Vetter wrote:
> On Mon, May 2, 2011 at 8:40 PM, Marcin Slusarz <marcin.slusarz@gmail.com> wrote:
> > On Mon, May 02, 2011 at 03:11:00PM +0200, Daniel Vetter wrote:
> >> On Mon, May 2, 2011 at 2:56 PM, Benjamin Franzke
> >> <benjaminfranzke@googlemail.com> wrote:
> >> > I think in i915g the CURSOR flag should be used in i9x5_scanout_layout
> >> > for the "special case for cursors" as well, instead of only checking
> >> > only pt->width0 == 64 && pt->height0 == 64.
> >>
> >> Oops, so much for actually re-checking the code. On the other hand, that
> >> part is broken, it needs a
> >>    tex->tiling = I915_TILE_NONE;
> >> and perhaps some check that width == height == 64 indeed holds. Then
> >> move it out as the first if clause and it'd start to make sense ...
> >
> > Could you fix it in separate patch?
> 
> Jakob has said (on irc) that he intends to again play with xorg-i915g ...

Christoph commited generic and nv50 part (Thanks again!).
i915 part below.

---
From: Marcin Slusarz <marcin.slusarz@gmail.com>
Subject: [PATCH] i915: use PIPE_BIND_CURSOR

---
 src/gallium/drivers/i915/i915_resource_texture.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)

diff --git a/src/gallium/drivers/i915/i915_resource_texture.c b/src/gallium/drivers/i915/i915_resource_texture.c
index e05b059..97ac012 100644
--- a/src/gallium/drivers/i915/i915_resource_texture.c
+++ b/src/gallium/drivers/i915/i915_resource_texture.c
@@ -825,11 +825,7 @@ i915_texture_create(struct pipe_screen *screen,
    }
 
    /* for scanouts and cursors, cursors arn't scanouts */
-
-   /* XXX: use a custom flag for cursors, don't rely on magically
-    * guessing that this is Xorg asking for a cursor
-    */
-   if ((template->bind & PIPE_BIND_SCANOUT) && template->width0 != 64)
+   if ((template->bind & PIPE_BIND_SCANOUT) && !(template->bind & PIPE_BIND_CURSOR))
       buf_usage = I915_NEW_SCANOUT;
    else
       buf_usage = I915_NEW_TEXTURE;
-- 
1.7.4.1
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-05-08 22:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-01 21:59 [PATCH] gallium/xorg st/nv50/i915: add PIPE_BIND_CURSOR Marcin Slusarz
2011-05-02 12:44 ` Daniel Vetter
2011-05-02 12:56   ` Benjamin Franzke
     [not found]     ` <BANLkTikbYs7y2gCELyyi1OKcuZYYVCfieA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2011-05-02 13:11       ` [Mesa-dev] " Daniel Vetter
2011-05-02 18:40         ` Marcin Slusarz
2011-05-03 10:06           ` Daniel Vetter
2011-05-08 22:33             ` Marcin Slusarz

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.