Re: [Mesa-dev] [PATCH vmwgfx] update for XA API changes

2013-07-24 Thread Jakob Bornecrantz
Sure, okay with me. I'll push this patch to the video-vmware repo.

Cheers, Jakob.


On Thu, Jul 25, 2013 at 1:20 AM, Rob Clark  wrote:

> On Wed, Jul 24, 2013 at 6:33 PM, Jakob Bornecrantz 
> wrote:
> > On Thu, Jul 11, 2013 at 1:58 AM, Jakob Bornecrantz  >
> > wrote:
> >>
> >> Just tried this out, on your XA branch, and I'm getting rendering
> >> issues in gnome-terminal. It looks like some text is offset by
> >> one or two lines, and the rest looks a bit like pitch issues.
> >>
> >> http://i.imgur.com/mdivF0q.png
> >>
> >> I can't really see anything in the patch that would cause this,
> >> going to take a extra look at the xa patches on the mesa sida.
> >
> >
> > Okay, I did some testing and reverted the commit
> > "b89ac75 xa: fix dma copy function" and I saw no rendering errors.
>
> cool, then if it is ok I'll push the rest minus the freedreno ones
> (until I have a chance to create a loader for xa)..
>
> BR,
> -R
>
> > Cheers, Jakob.
> >
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH vmwgfx] update for XA API changes

2013-07-24 Thread Rob Clark
On Wed, Jul 24, 2013 at 6:33 PM, Jakob Bornecrantz  wrote:
> On Thu, Jul 11, 2013 at 1:58 AM, Jakob Bornecrantz 
> wrote:
>>
>> Just tried this out, on your XA branch, and I'm getting rendering
>> issues in gnome-terminal. It looks like some text is offset by
>> one or two lines, and the rest looks a bit like pitch issues.
>>
>> http://i.imgur.com/mdivF0q.png
>>
>> I can't really see anything in the patch that would cause this,
>> going to take a extra look at the xa patches on the mesa sida.
>
>
> Okay, I did some testing and reverted the commit
> "b89ac75 xa: fix dma copy function" and I saw no rendering errors.

cool, then if it is ok I'll push the rest minus the freedreno ones
(until I have a chance to create a loader for xa)..

BR,
-R

> Cheers, Jakob.
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH vmwgfx] update for XA API changes

2013-07-24 Thread Jakob Bornecrantz
On Thu, Jul 11, 2013 at 1:58 AM, Jakob Bornecrantz wrote:

> Just tried this out, on your XA branch, and I'm getting rendering
> issues in gnome-terminal. It looks like some text is offset by
> one or two lines, and the rest looks a bit like pitch issues.
>
> http://i.imgur.com/mdivF0q.png
>
> I can't really see anything in the patch that would cause this,
> going to take a extra look at the xa patches on the mesa sida.
>

Okay, I did some testing and reverted the commit
"b89ac75 xa: fix dma copy function" and I saw no rendering errors.

Cheers, Jakob.
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH vmwgfx] update for XA API changes

2013-07-10 Thread Jakob Bornecrantz
Just tried this out, on your XA branch, and I'm getting rendering
issues in gnome-terminal. It looks like some text is offset by
one or two lines, and the rest looks a bit like pitch issues.

http://i.imgur.com/mdivF0q.png

I can't really see anything in the patch that would cause this,
going to take a extra look at the xa patches on the mesa sida.

Cheers, Jakob.


On Mon, Jun 10, 2013 at 7:31 PM, Rob Clark  wrote:

> Only just compile tested, as I don't have the "hardware" for it..
>
> Signed-off-by: Rob Clark 
> ---
>  configure.ac  |  2 +-
>  vmwgfx/vmwgfx_dri2.c  |  5 +++--
>  vmwgfx/vmwgfx_driver.c|  3 ++-
>  vmwgfx/vmwgfx_saa.c   | 20 ++--
>  vmwgfx/vmwgfx_tex_video.c |  5 +++--
>  5 files changed, 23 insertions(+), 12 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index 0631bcc..dccfb27 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -118,7 +118,7 @@ if test x$BUILD_VMWGFX = xyes; then
> PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no])
>  fi
>  if test x$BUILD_VMWGFX = xyes; then
> -   PKG_CHECK_MODULES([XATRACKER], [xatracker >=
> 0.4.0],[],[BUILD_VMWGFX=no])
> +   PKG_CHECK_MODULES([XATRACKER], [xatracker >=
> 2.0.0],[],[BUILD_VMWGFX=no])
>  fi
>
>  DRIVER_NAME=vmware
> diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c
> index 7de0772..2f007f0 100644
> --- a/vmwgfx/vmwgfx_dri2.c
> +++ b/vmwgfx/vmwgfx_dri2.c
> @@ -201,7 +201,8 @@ dri2_do_create_buffer(DrawablePtr pDraw,
> DRI2Buffer2Ptr buffer, unsigned int for
>  }
>
>  private->srf = srf;
> -if (xa_surface_handle(srf, &buffer->name, &buffer->pitch) != 0)
> +if (xa_surface_handle(srf, xa_handle_type_shared,
> +   &buffer->name, &buffer->pitch) != 0)
> return FALSE;
>
>  buffer->cpp = xa_format_depth(xa_surface_format(srf)) / 8;
> @@ -222,7 +223,7 @@ dri2_do_destroy_buffer(DrawablePtr pDraw,
> DRI2BufferPtr buffer)
>  struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(private->pPixmap);
>
>  if (--private->refcount == 0 && srf) {
> -   xa_surface_destroy(srf);
> +   xa_surface_unref(srf);
>  }
>
>  /*
> diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
> index 7863ba2..3002285 100644
> --- a/vmwgfx/vmwgfx_driver.c
> +++ b/vmwgfx/vmwgfx_driver.c
> @@ -617,7 +617,8 @@ vmwgfx_scanout_present(ScreenPtr pScreen, int drm_fd,
> return FALSE;
>  }
>
> -if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0) {
> +if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
> +   &handle, &dummy) != 0) {
> LogMessage(X_ERROR, "Could not get present surface handle.\n");
> return FALSE;
>  }
> diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
> index 63df3a1..ed3c1ee 100644
> --- a/vmwgfx/vmwgfx_saa.c
> +++ b/vmwgfx/vmwgfx_saa.c
> @@ -140,7 +140,7 @@ vmwgfx_pixmap_free_storage(struct vmwgfx_saa_pixmap
> *vpix)
> vpix->malloc = NULL;
>  }
>  if (!(vpix->backing & VMWGFX_PIX_SURFACE) && vpix->hw) {
> -   xa_surface_destroy(vpix->hw);
> +   xa_surface_unref(vpix->hw);
> vpix->hw = NULL;
>  }
>  if (!(vpix->backing & VMWGFX_PIX_GMR) && vpix->gmr) {
> @@ -286,7 +286,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
>  if (vpix->gmr && vsaa->can_optimize_dma) {
> uint32_t handle, dummy;
>
> -   if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
> +   if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
> +&handle, &dummy) != 0)
> goto out_err;
> if (vmwgfx_dma(0, 0, reg, vpix->gmr, pixmap->devKind, handle,
>to_hw) != 0)
> @@ -305,6 +306,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
>  (int) to_hw,
>  (struct xa_box *) REGION_RECTS(reg),
>  REGION_NUM_RECTS(reg));
> +   if (to_hw)
> +   xa_context_flush(vsaa->xa_ctx);
> if (vpix->gmr)
> vmwgfx_dmabuf_unmap(vpix->gmr);
> if (ret)
> @@ -441,7 +444,7 @@ vmwgfx_hw_kill(struct vmwgfx_saa *vsaa,
>  &spix->dirty_hw))
> return FALSE;
>
> -xa_surface_destroy(vpix->hw);
> +xa_surface_unref(vpix->hw);
>  vpix->hw = NULL;
>
>  /*
> @@ -683,7 +686,8 @@ vmwgfx_present_prepare(struct vmwgfx_saa *vsaa,
>
>  (void) pScreen;
>  if (src_vpix == dst_vpix || !src_vpix->hw ||
> -   xa_surface_handle(src_vpix->hw, &vsaa->src_handle, &dummy) != 0)
> +   xa_surface_handle(src_vpix->hw, xa_handle_type_shared,
> +   &vsaa->src_handle, &dummy) != 0)
> return FALSE;
>
>  REGION_NULL(pScreen, &vsaa->present_region);
> @@ -784,7 +788,7 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
>  return TRUE;
>
>  out_no_damage:
> -xa_surface_destroy(hw);
> +xa_surface_unref(hw);
>  return FALSE;
>  }
>
> @@ -929,6 +933,7 @@ vmwgfx_copy_prepare(struct saa_driver *driver,
>
> if (!vmwgfx_hw_validate

[Mesa-dev] [PATCH vmwgfx] update for XA API changes

2013-06-10 Thread Rob Clark
Only just compile tested, as I don't have the "hardware" for it..

Signed-off-by: Rob Clark 
---
 configure.ac  |  2 +-
 vmwgfx/vmwgfx_dri2.c  |  5 +++--
 vmwgfx/vmwgfx_driver.c|  3 ++-
 vmwgfx/vmwgfx_saa.c   | 20 ++--
 vmwgfx/vmwgfx_tex_video.c |  5 +++--
 5 files changed, 23 insertions(+), 12 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0631bcc..dccfb27 100644
--- a/configure.ac
+++ b/configure.ac
@@ -118,7 +118,7 @@ if test x$BUILD_VMWGFX = xyes; then
PKG_CHECK_MODULES([LIBDRM], [libdrm],[],[BUILD_VMWGFX=no])
 fi
 if test x$BUILD_VMWGFX = xyes; then
-   PKG_CHECK_MODULES([XATRACKER], [xatracker >= 
0.4.0],[],[BUILD_VMWGFX=no])
+   PKG_CHECK_MODULES([XATRACKER], [xatracker >= 
2.0.0],[],[BUILD_VMWGFX=no])
 fi
 
 DRIVER_NAME=vmware
diff --git a/vmwgfx/vmwgfx_dri2.c b/vmwgfx/vmwgfx_dri2.c
index 7de0772..2f007f0 100644
--- a/vmwgfx/vmwgfx_dri2.c
+++ b/vmwgfx/vmwgfx_dri2.c
@@ -201,7 +201,8 @@ dri2_do_create_buffer(DrawablePtr pDraw, DRI2Buffer2Ptr 
buffer, unsigned int for
 }
 
 private->srf = srf;
-if (xa_surface_handle(srf, &buffer->name, &buffer->pitch) != 0)
+if (xa_surface_handle(srf, xa_handle_type_shared,
+   &buffer->name, &buffer->pitch) != 0)
return FALSE;
 
 buffer->cpp = xa_format_depth(xa_surface_format(srf)) / 8;
@@ -222,7 +223,7 @@ dri2_do_destroy_buffer(DrawablePtr pDraw, DRI2BufferPtr 
buffer)
 struct vmwgfx_saa_pixmap *vpix = vmwgfx_saa_pixmap(private->pPixmap);
 
 if (--private->refcount == 0 && srf) {
-   xa_surface_destroy(srf);
+   xa_surface_unref(srf);
 }
 
 /*
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c
index 7863ba2..3002285 100644
--- a/vmwgfx/vmwgfx_driver.c
+++ b/vmwgfx/vmwgfx_driver.c
@@ -617,7 +617,8 @@ vmwgfx_scanout_present(ScreenPtr pScreen, int drm_fd,
return FALSE;
 }
 
-if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0) {
+if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
+   &handle, &dummy) != 0) {
LogMessage(X_ERROR, "Could not get present surface handle.\n");
return FALSE;
 }
diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c
index 63df3a1..ed3c1ee 100644
--- a/vmwgfx/vmwgfx_saa.c
+++ b/vmwgfx/vmwgfx_saa.c
@@ -140,7 +140,7 @@ vmwgfx_pixmap_free_storage(struct vmwgfx_saa_pixmap *vpix)
vpix->malloc = NULL;
 }
 if (!(vpix->backing & VMWGFX_PIX_SURFACE) && vpix->hw) {
-   xa_surface_destroy(vpix->hw);
+   xa_surface_unref(vpix->hw);
vpix->hw = NULL;
 }
 if (!(vpix->backing & VMWGFX_PIX_GMR) && vpix->gmr) {
@@ -286,7 +286,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
 if (vpix->gmr && vsaa->can_optimize_dma) {
uint32_t handle, dummy;
 
-   if (xa_surface_handle(vpix->hw, &handle, &dummy) != 0)
+   if (xa_surface_handle(vpix->hw, xa_handle_type_shared,
+&handle, &dummy) != 0)
goto out_err;
if (vmwgfx_dma(0, 0, reg, vpix->gmr, pixmap->devKind, handle,
   to_hw) != 0)
@@ -305,6 +306,8 @@ vmwgfx_saa_dma(struct vmwgfx_saa *vsaa,
 (int) to_hw,
 (struct xa_box *) REGION_RECTS(reg),
 REGION_NUM_RECTS(reg));
+   if (to_hw)
+   xa_context_flush(vsaa->xa_ctx);
if (vpix->gmr)
vmwgfx_dmabuf_unmap(vpix->gmr);
if (ret)
@@ -441,7 +444,7 @@ vmwgfx_hw_kill(struct vmwgfx_saa *vsaa,
 &spix->dirty_hw))
return FALSE;
 
-xa_surface_destroy(vpix->hw);
+xa_surface_unref(vpix->hw);
 vpix->hw = NULL;
 
 /*
@@ -683,7 +686,8 @@ vmwgfx_present_prepare(struct vmwgfx_saa *vsaa,
 
 (void) pScreen;
 if (src_vpix == dst_vpix || !src_vpix->hw ||
-   xa_surface_handle(src_vpix->hw, &vsaa->src_handle, &dummy) != 0)
+   xa_surface_handle(src_vpix->hw, xa_handle_type_shared,
+   &vsaa->src_handle, &dummy) != 0)
return FALSE;
 
 REGION_NULL(pScreen, &vsaa->present_region);
@@ -784,7 +788,7 @@ vmwgfx_create_hw(struct vmwgfx_saa *vsaa,
 return TRUE;
 
 out_no_damage:
-xa_surface_destroy(hw);
+xa_surface_unref(hw);
 return FALSE;
 }
 
@@ -929,6 +933,7 @@ vmwgfx_copy_prepare(struct saa_driver *driver,
 
if (!vmwgfx_hw_validate(src_pixmap, src_reg)) {
xa_copy_done(vsaa->xa_ctx);
+   xa_context_flush(vsaa->xa_ctx);
return FALSE;
}
 
@@ -1029,6 +1034,7 @@ vmwgfx_copy_done(struct saa_driver *driver)
return;
 }
 xa_copy_done(vsaa->xa_ctx);
+xa_context_flush(vsaa->xa_ctx);
 }
 
 static Bool
@@ -1175,6 +1181,7 @@ vmwgfx_composite_done(struct saa_driver *driver)
struct vmwgfx_saa *vsaa = to_vmwgfx_saa(driver);
 
xa_composite_done(vsaa->xa_ctx);
+   xa_context_flush(vsaa->xa_ctx);
 }
 
 static void
@@ -1436,7 +1443,8 @@ vmwgfx_scanout_ref(struct vmwgfx_screen_entry  *entry)
 */