Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-06-16 Thread Ilia Mirkin
On Fri, Jun 16, 2017 at 8:15 AM, Emil Velikov  wrote:
> On 16 June 2017 at 13:11, Ilia Mirkin  wrote:
>> On Jun 16, 2017 8:09 AM, "Emil Velikov"  wrote:
>>
>> On 16 June 2017 at 13:00, Ilia Mirkin  wrote:
>>> On Fri, Jun 16, 2017 at 7:51 AM, Emil Velikov 
>>> wrote:
 On 25 April 2017 at 15:32, Emil Velikov  wrote:
> On 25 April 2017 at 15:06, Christian König 
> wrote:
>> Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:
>>>
>>> [SNIP]
>>> Is there a patch I should test?
>>
>>
>> Patch is attached, but only compile tested.
>>
>> Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
>> still keep working.
>>
> I think we can make nouveau_drm_screen_create private and drop it from
> dri.sym, vdpau.sym + dri-vdpau.dyn
> Not 100% sure though ... we might need it for Xinerama.
>
 Ilia, did you had the chance to test the patch with or w/o the extra
 bits suggested?
>>>
>>> This was not on my radar for testing. What needs testing exactly?
>>
>>> Apply the patch and see if OpenGL/VDPAU in Kodi/MPV still works with
>>> nouveau.
>>> Do try it with DRI2 and DRI3. My extra suggestions can be sorted at a
>>> later stage.
>>>
>>> https://patchwork.freedesktop.org/patch/152674/
>>>
>>
>> Opengl + vdpau never work in mpv/Kodi. Problem solved?
>>
> Hmm surely GL VDPAU interop worked somewhere/somehow? Maarten do you
> recall how/where you tested it as you added the nouveau bits?
>
> If nothing comes to mind, we might as well merge the patch. I have a
> crazy idea that the patch alongside few extra actually might get it
> working ;-) But that for later.

GL/VDPAU interop works. Just not the way that mpv/kodi use it (at
least today). I'm not inclined to particularly worry about it... this
can all be reverted later if necessary.

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-06-16 Thread Emil Velikov
On 16 June 2017 at 13:11, Ilia Mirkin  wrote:
> On Jun 16, 2017 8:09 AM, "Emil Velikov"  wrote:
>
> On 16 June 2017 at 13:00, Ilia Mirkin  wrote:
>> On Fri, Jun 16, 2017 at 7:51 AM, Emil Velikov 
>> wrote:
>>> On 25 April 2017 at 15:32, Emil Velikov  wrote:
 On 25 April 2017 at 15:06, Christian König 
 wrote:
> Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:
>>
>> [SNIP]
>> Is there a patch I should test?
>
>
> Patch is attached, but only compile tested.
>
> Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
> still keep working.
>
 I think we can make nouveau_drm_screen_create private and drop it from
 dri.sym, vdpau.sym + dri-vdpau.dyn
 Not 100% sure though ... we might need it for Xinerama.

>>> Ilia, did you had the chance to test the patch with or w/o the extra
>>> bits suggested?
>>
>> This was not on my radar for testing. What needs testing exactly?
>
>> Apply the patch and see if OpenGL/VDPAU in Kodi/MPV still works with
>> nouveau.
>> Do try it with DRI2 and DRI3. My extra suggestions can be sorted at a
>> later stage.
>>
>> https://patchwork.freedesktop.org/patch/152674/
>>
>
> Opengl + vdpau never work in mpv/Kodi. Problem solved?
>
Hmm surely GL VDPAU interop worked somewhere/somehow? Maarten do you
recall how/where you tested it as you added the nouveau bits?

If nothing comes to mind, we might as well merge the patch. I have a
crazy idea that the patch alongside few extra actually might get it
working ;-) But that for later.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-06-16 Thread Ilia Mirkin
On Jun 16, 2017 8:09 AM, "Emil Velikov"  wrote:

On 16 June 2017 at 13:00, Ilia Mirkin  wrote:
> On Fri, Jun 16, 2017 at 7:51 AM, Emil Velikov 
wrote:
>> On 25 April 2017 at 15:32, Emil Velikov  wrote:
>>> On 25 April 2017 at 15:06, Christian König 
wrote:
 Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:
>
> [SNIP]
> Is there a patch I should test?


 Patch is attached, but only compile tested.

 Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
 still keep working.

>>> I think we can make nouveau_drm_screen_create private and drop it from
>>> dri.sym, vdpau.sym + dri-vdpau.dyn
>>> Not 100% sure though ... we might need it for Xinerama.
>>>
>> Ilia, did you had the chance to test the patch with or w/o the extra
>> bits suggested?
>
> This was not on my radar for testing. What needs testing exactly?

Apply the patch and see if OpenGL/VDPAU in Kodi/MPV still works with
nouveau.
Do try it with DRI2 and DRI3. My extra suggestions can be sorted at a
later stage.

https://patchwork.freedesktop.org/patch/152674/


Opengl + vdpau never work in mpv/Kodi. Problem solved?



-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-06-16 Thread Emil Velikov
On 16 June 2017 at 13:00, Ilia Mirkin  wrote:
> On Fri, Jun 16, 2017 at 7:51 AM, Emil Velikov  
> wrote:
>> On 25 April 2017 at 15:32, Emil Velikov  wrote:
>>> On 25 April 2017 at 15:06, Christian König  wrote:
 Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:
>
> [SNIP]
> Is there a patch I should test?


 Patch is attached, but only compile tested.

 Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
 still keep working.

>>> I think we can make nouveau_drm_screen_create private and drop it from
>>> dri.sym, vdpau.sym + dri-vdpau.dyn
>>> Not 100% sure though ... we might need it for Xinerama.
>>>
>> Ilia, did you had the chance to test the patch with or w/o the extra
>> bits suggested?
>
> This was not on my radar for testing. What needs testing exactly?

Apply the patch and see if OpenGL/VDPAU in Kodi/MPV still works with nouveau.
Do try it with DRI2 and DRI3. My extra suggestions can be sorted at a
later stage.

https://patchwork.freedesktop.org/patch/152674/

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-06-16 Thread Ilia Mirkin
On Fri, Jun 16, 2017 at 7:51 AM, Emil Velikov  wrote:
> On 25 April 2017 at 15:32, Emil Velikov  wrote:
>> On 25 April 2017 at 15:06, Christian König  wrote:
>>> Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:

 [SNIP]
 Is there a patch I should test?
>>>
>>>
>>> Patch is attached, but only compile tested.
>>>
>>> Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
>>> still keep working.
>>>
>> I think we can make nouveau_drm_screen_create private and drop it from
>> dri.sym, vdpau.sym + dri-vdpau.dyn
>> Not 100% sure though ... we might need it for Xinerama.
>>
> Ilia, did you had the chance to test the patch with or w/o the extra
> bits suggested?

This was not on my radar for testing. What needs testing exactly?
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-06-16 Thread Emil Velikov
On 25 April 2017 at 15:32, Emil Velikov  wrote:
> On 25 April 2017 at 15:06, Christian König  wrote:
>> Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:
>>>
>>> [SNIP]
>>> Is there a patch I should test?
>>
>>
>> Patch is attached, but only compile tested.
>>
>> Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
>> still keep working.
>>
> I think we can make nouveau_drm_screen_create private and drop it from
> dri.sym, vdpau.sym + dri-vdpau.dyn
> Not 100% sure though ... we might need it for Xinerama.
>
Ilia, did you had the chance to test the patch with or w/o the extra
bits suggested?

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-04-25 Thread Emil Velikov
On 25 April 2017 at 15:06, Christian König  wrote:
> Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:
>>
>> [SNIP]
>> Is there a patch I should test?
>
>
> Patch is attached, but only compile tested.
>
> Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should
> still keep working.
>
I think we can make nouveau_drm_screen_create private and drop it from
dri.sym, vdpau.sym + dri-vdpau.dyn
Not 100% sure though ... we might need it for Xinerama.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-04-25 Thread Christian König

Am 25.04.2017 um 15:17 schrieb Ilia Mirkin:

[SNIP]
Is there a patch I should test?


Patch is attached, but only compile tested.

Basically if OpenGL/VDPAU interop worked before with Kodi/MPV it should 
still keep working.


Christian.



   -ilia



>From a01c07d52dc283fb97d36d54e6c9b706160973b9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Christian=20K=C3=B6nig?= 
Date: Tue, 25 Apr 2017 16:04:42 +0200
Subject: [PATCH] st/vdpau: drop old OpenGL VDPAU interop
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Replaced by the DMA-buf based interop.

Signed-off-by: Christian König 
---
 src/gallium/include/state_tracker/vdpau_interop.h | 54 ---
 src/gallium/state_trackers/vdpau/ftab.c   |  4 +-
 src/gallium/state_trackers/vdpau/output.c | 15 --
 src/gallium/state_trackers/vdpau/surface.c| 18 ---
 src/gallium/state_trackers/vdpau/vdpau_private.h  |  3 --
 src/mesa/state_tracker/st_vdpau.c | 64 +--
 6 files changed, 4 insertions(+), 154 deletions(-)
 delete mode 100644 src/gallium/include/state_tracker/vdpau_interop.h

diff --git a/src/gallium/include/state_tracker/vdpau_interop.h b/src/gallium/include/state_tracker/vdpau_interop.h
deleted file mode 100644
index 04d455a..000
--- a/src/gallium/include/state_tracker/vdpau_interop.h
+++ /dev/null
@@ -1,54 +0,0 @@
-/**
- *
- * Copyright 2013 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **/
-
-/*
- * Authors:
- *  Christian König 
- *
- */
-
-#ifndef _VDPAU_INTEROP_H_
-#define _VDPAU_INTEROP_H_
-
-/* driver specific functions for NV_vdpau_interop */
-#ifndef VDP_FUNC_ID_BASE_DRIVER
-#define VDP_FUNC_ID_BASE_DRIVER 0x2000
-#endif
-
-/* Older implementation relying on passing pipe_video_buffer and
- * pipe_resources around. Deprecated and shouldn't be used for new things.
- */
-#define VDP_FUNC_ID_VIDEO_SURFACE_GALLIUM (VDP_FUNC_ID_BASE_DRIVER + 0)
-#define VDP_FUNC_ID_OUTPUT_SURFACE_GALLIUM (VDP_FUNC_ID_BASE_DRIVER + 1)
-
-struct pipe_resource;
-struct pipe_video_buffer;
-
-typedef struct pipe_video_buffer *VdpVideoSurfaceGallium(uint32_t surface);
-typedef struct pipe_resource *VdpOutputSurfaceGallium(uint32_t surface);
-
-#endif /* _VDPAU_INTEROP_H_ */
diff --git a/src/gallium/state_trackers/vdpau/ftab.c b/src/gallium/state_trackers/vdpau/ftab.c
index 3178622..a50344f 100644
--- a/src/gallium/state_trackers/vdpau/ftab.c
+++ b/src/gallium/state_trackers/vdpau/ftab.c
@@ -109,8 +109,8 @@ static void* ftab_winsys[1] =
 
 static void* ftab_driver[4] =
 {
-   , /* VDP_FUNC_ID_SURFACE_GALLIUM */
-   , /* VDP_FUNC_ID_OUTPUT_SURFACE_GALLIUM */
+   NULL, /* VDP_FUNC_ID_SURFACE_GALLIUM */
+   NULL, /* VDP_FUNC_ID_OUTPUT_SURFACE_GALLIUM */
, /* VDP_FUNC_ID_VIDEO_SURFACE_DMA_BUF */
 /* VDP_FUNC_ID_OUTPUT_SURFACE_DMA_BUF */
 };
diff --git a/src/gallium/state_trackers/vdpau/output.c b/src/gallium/state_trackers/vdpau/output.c
index 8ef8268..bde8c5d 100644
--- a/src/gallium/state_trackers/vdpau/output.c
+++ b/src/gallium/state_trackers/vdpau/output.c
@@ -772,21 +772,6 @@ vlVdpOutputSurfaceRenderBitmapSurface(VdpOutputSurface destination_surface,
return VDP_STATUS_OK;
 }
 
-struct pipe_resource *vlVdpOutputSurfaceGallium(VdpOutputSurface surface)
-{
-   vlVdpOutputSurface *vlsurface;
-
-   vlsurface = vlGetDataHTAB(surface);
-   if (!vlsurface || !vlsurface->surface)
-  return NULL;
-
-   mtx_lock(>device->mutex);
-   vlsurface->device->context->flush(vlsurface->device->context, NULL, 0);
-   mtx_unlock(>device->mutex);
-
-   return vlsurface->surface->texture;
-}
-
 VdpStatus 

Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-04-25 Thread Ilia Mirkin
On Tue, Apr 25, 2017 at 8:51 AM, Christian König
 wrote:
> Am 21.04.2017 um 15:38 schrieb Emil Velikov:
>>
>> On 21 April 2017 at 13:31, Christian König 
>> wrote:
>>>
>>> Am 21.04.2017 um 14:11 schrieb Emil Velikov:

 Both headers are used everywhere, plus they both provide interop
 mechanism.

 Since they define [consecutive] VDPAU driver funcs, we really want the
 definitions side by side. Otherwise we risk clashing multiple functions
 at the same address.

 Cc: Christian König 
 Signed-off-by: Emil Velikov 
>>>
>>>
>>> NAK, the seperation is intentional. vdpau_interop.h is the old one we
>>> sooner
>>> or later want to remove.
>>>
>> Right. How about we do a very rough ETA?
>> We've have many parts that are we are about to nuke soon(tm) yet it
>> never seems to happen.
>
>
> I usually set a reminder a few years into the future for that.
>
> But enough kidding. I'm fine with removing it, but I think it would break
> nouveau and I don't have any chance of testing that.

Is there a patch I should test?

  -ilia
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-04-25 Thread Christian König

Am 21.04.2017 um 15:38 schrieb Emil Velikov:

On 21 April 2017 at 13:31, Christian König  wrote:

Am 21.04.2017 um 14:11 schrieb Emil Velikov:

Both headers are used everywhere, plus they both provide interop
mechanism.

Since they define [consecutive] VDPAU driver funcs, we really want the
definitions side by side. Otherwise we risk clashing multiple functions
at the same address.

Cc: Christian König 
Signed-off-by: Emil Velikov 


NAK, the seperation is intentional. vdpau_interop.h is the old one we sooner
or later want to remove.


Right. How about we do a very rough ETA?
We've have many parts that are we are about to nuke soon(tm) yet it
never seems to happen.


I usually set a reminder a few years into the future for that.

But enough kidding. I'm fine with removing it, but I think it would 
break nouveau and I don't have any chance of testing that.


Christian.



-Emil



___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-04-21 Thread Emil Velikov
On 21 April 2017 at 13:31, Christian König  wrote:
> Am 21.04.2017 um 14:11 schrieb Emil Velikov:
>>
>> Both headers are used everywhere, plus they both provide interop
>> mechanism.
>>
>> Since they define [consecutive] VDPAU driver funcs, we really want the
>> definitions side by side. Otherwise we risk clashing multiple functions
>> at the same address.
>>
>> Cc: Christian König 
>> Signed-off-by: Emil Velikov 
>
>
> NAK, the seperation is intentional. vdpau_interop.h is the old one we sooner
> or later want to remove.
>
Right. How about we do a very rough ETA?
We've have many parts that are we are about to nuke soon(tm) yet it
never seems to happen.

-Emil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 2/2] st/vdpau: fold vdpau_interop.h and vdpau_dmabuf.h

2017-04-21 Thread Christian König

Am 21.04.2017 um 14:11 schrieb Emil Velikov:

Both headers are used everywhere, plus they both provide interop
mechanism.

Since they define [consecutive] VDPAU driver funcs, we really want the
definitions side by side. Otherwise we risk clashing multiple functions
at the same address.

Cc: Christian König 
Signed-off-by: Emil Velikov 


NAK, the seperation is intentional. vdpau_interop.h is the old one we 
sooner or later want to remove.


And vdpau_dmabuf.h is the new one we want to keep.

Regards,
Christian.


---
  src/gallium/include/state_tracker/vdpau_dmabuf.h  | 110 --
  src/gallium/include/state_tracker/vdpau_interop.h |  75 ++-
  src/gallium/state_trackers/vdpau/vdpau_private.h  |   1 -
  src/mesa/state_tracker/st_vdpau.c |   1 -
  4 files changed, 72 insertions(+), 115 deletions(-)
  delete mode 100644 src/gallium/include/state_tracker/vdpau_dmabuf.h

diff --git a/src/gallium/include/state_tracker/vdpau_dmabuf.h 
b/src/gallium/include/state_tracker/vdpau_dmabuf.h
deleted file mode 100644
index 47c20b48ae6..000
--- a/src/gallium/include/state_tracker/vdpau_dmabuf.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/**
- *
- * Copyright 2016 Advanced Micro Devices, Inc.
- * All Rights Reserved.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the
- * "Software"), to deal in the Software without restriction, including
- * without limitation the rights to use, copy, modify, merge, publish,
- * distribute, sub license, and/or sell copies of the Software, and to
- * permit persons to whom the Software is furnished to do so, subject to
- * the following conditions:
- *
- * The above copyright notice and this permission notice (including the
- * next paragraph) shall be included in all copies or substantial portions
- * of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
- * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
- * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR
- * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
- * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
- * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
- *
- **/
-
-/*
- * Authors:
- *  Christian König 
- *
- */
-
-#ifndef _VDPAU_DMABUF_H_
-#define _VDPAU_DMABUF_H_
-
-#include 
-#include "pipe/p_format.h"
-
-/* driver specific functions for NV_vdpau_interop */
-#ifndef VDP_FUNC_ID_BASE_DRIVER
-#define VDP_FUNC_ID_BASE_DRIVER 0x2000
-#endif
-
-/* New DMA-buf based implementation */
-#define VDP_FUNC_ID_VIDEO_SURFACE_DMA_BUF (VDP_FUNC_ID_BASE_DRIVER + 2)
-#define VDP_FUNC_ID_OUTPUT_SURFACE_DMA_BUF (VDP_FUNC_ID_BASE_DRIVER + 3)
-
-/* Define some more internal RGBA formats for more
- * robust handling of Video Surfaces
- */
-#define VDP_RGBA_FORMAT_R8  (-1)
-#define VDP_RGBA_FORMAT_R8G8(-2)
-
-static inline enum pipe_format
-VdpCustomFormatRGBAToPipe(uint32_t vdpau_format)
-{
-   switch (vdpau_format) {
-   case VDP_RGBA_FORMAT_R8:
-  return PIPE_FORMAT_R8_UNORM;
-   case VDP_RGBA_FORMAT_R8G8:
-  return PIPE_FORMAT_R8G8_UNORM;
-   default:
-  assert(0);
-   }
-
-   return PIPE_FORMAT_NONE;
-}
-
-struct VdpSurfaceDMABufDesc {
-   /* DMA-buf file descriptor */
-   uint32_t handle;
-   /* Width in pixel */
-   uint32_t width;
-   /* Height in pixel */
-   uint32_t height;
-   /* Offset in bytes */
-   uint32_t offset;
-   /* Stride in bytes */
-   uint32_t stride;
-   /* VDP_RGBA_FORMAT_* as defined above. */
-   uint32_t format;
-};
-
-/**
- * \brief Video surface planes
- */
-typedef uint32_t VdpVideoSurfacePlane;
-
-/** \hideinitializer \brief Luma top field */
-#define VDP_VIDEO_SURFACE_PLANE_LUMA_TOP  ((VdpVideoSurfacePlane)0)
-/** \hideinitializer \brief Luma bottom field */
-#define VDP_VIDEO_SURFACE_PLANE_LUMA_BOTTOM   ((VdpVideoSurfacePlane)1)
-/** \hideinitializer \brief Chroma top field */
-#define VDP_VIDEO_SURFACE_PLANE_CHROMA_TOP((VdpVideoSurfacePlane)2)
-/** \hideinitializer \brief Chroma bottom field */
-#define VDP_VIDEO_SURFACE_PLANE_CHROMA_BOTTOM ((VdpVideoSurfacePlane)3)
-
-typedef VdpStatus VdpVideoSurfaceDMABuf(
-   VdpVideoSurface   surface,
-   VdpVideoSurfacePlane  plane,
-   struct VdpSurfaceDMABufDesc * result
-);
-
-typedef VdpStatus VdpOutputSurfaceDMABuf(
-   VdpOutputSurface  surface,
-   struct VdpSurfaceDMABufDesc * result
-);
-
-#endif /* _VDPAU_DMABUF_H_ */
diff --git a/src/gallium/include/state_tracker/vdpau_interop.h 
b/src/gallium/include/state_tracker/vdpau_interop.h
index