diff options
author | Christian König <[email protected]> | 2013-05-15 15:10:11 +0200 |
---|---|---|
committer | Christian König <[email protected]> | 2013-10-26 12:13:36 +0200 |
commit | 80964226e9b8a05c39157f9305c06c0b2861e080 (patch) | |
tree | c4f1c11f0f3e82e0b8167b8cba21de6694f2f9d9 /src/gallium/state_trackers/vdpau/ftab.c | |
parent | 3d3a0b9b67982a96a4c4d87f78c21204f3a48776 (diff) |
implement NV_vdpau_interop v7
v2: Actually implement interop between the gallium
state tracker and the VDPAU backend.
v3: Make it also available in non legacy contexts,
fix video buffer sharing.
v4: deny interop if we don't have the same screen object
v5: rebased on upstream changes
v6: implemented VDPAUGetSurfaceivNV, improved error handling,
unregister all surfaces in VDPAUFiniNV
v7: squash merge with Mareks changes
Signed-off-by: Christian König <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/vdpau/ftab.c')
-rw-r--r-- | src/gallium/state_trackers/vdpau/ftab.c | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/vdpau/ftab.c b/src/gallium/state_trackers/vdpau/ftab.c index 81d16ec306a..2c84554cf83 100644 --- a/src/gallium/state_trackers/vdpau/ftab.c +++ b/src/gallium/state_trackers/vdpau/ftab.c @@ -26,6 +26,9 @@ **************************************************************************/ #include <assert.h> + +#include "util/u_memory.h" + #include "vdpau_private.h" static void* ftab[67] = @@ -104,19 +107,31 @@ static void* ftab_winsys[1] = &vlVdpPresentationQueueTargetCreateX11 /* VDP_FUNC_ID_PRESENTATION_QUEUE_TARGET_CREATE_X11 */ }; +static void* ftab_driver[2] = +{ + &vlVdpVideoSurfaceGallium, /* VDP_FUNC_ID_SURFACE_GALLIUM */ + &vlVdpOutputSurfaceGallium /* VDP_FUNC_ID_OUTPUT_SURFACE_GALLIUM */ +}; + boolean vlGetFuncFTAB(VdpFuncId function_id, void **func) { assert(func); + *func = NULL; + if (function_id < VDP_FUNC_ID_BASE_WINSYS) { - if (function_id > 66) - return FALSE; - *func = ftab[function_id]; - } - else { + if (function_id < Elements(ftab)) + *func = ftab[function_id]; + + } else if (function_id < VDP_FUNC_ID_BASE_DRIVER) { function_id -= VDP_FUNC_ID_BASE_WINSYS; - if (function_id > 0) - return FALSE; - *func = ftab_winsys[function_id]; + if (function_id < Elements(ftab_winsys)) + *func = ftab_winsys[function_id]; + + } else { + function_id -= VDP_FUNC_ID_BASE_DRIVER; + if (function_id < Elements(ftab_driver)) + *func = ftab_driver[function_id]; } + return *func != NULL; } |