Commit 9feaf333 authored by Marc-André Lureau's avatar Marc-André Lureau Committed by Dave Airlie

drisw: learn to query shmid handle type

Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
Reviewed-by: default avatarAdam Jackson <ajax@redhat.com>
parent bcd80be4
......@@ -2,6 +2,7 @@
#define _DRISW_API_H_
#include "pipe/p_compiler.h"
#include "sw_winsys.h"
struct pipe_screen;
struct dri_drawable;
......
......@@ -37,14 +37,13 @@
#include "pipe/p_compiler.h" /* for boolean */
#include "pipe/p_format.h"
#include "state_tracker/winsys_handle.h"
#ifdef __cplusplus
extern "C" {
#endif
struct winsys_handle;
struct pipe_screen;
struct pipe_context;
struct pipe_resource;
......
......@@ -9,6 +9,7 @@ extern "C" {
#define WINSYS_HANDLE_TYPE_SHARED 0
#define WINSYS_HANDLE_TYPE_KMS 1
#define WINSYS_HANDLE_TYPE_FD 2
#define WINSYS_HANDLE_TYPE_SHMID 3
/**
* For use with pipe_screen::{texture_from_handle|texture_get_handle}.
......
......@@ -209,7 +209,15 @@ dri_sw_displaytarget_get_handle(struct sw_winsys *winsys,
struct sw_displaytarget *dt,
struct winsys_handle *whandle)
{
assert(0);
struct dri_sw_displaytarget *dri_sw_dt = dri_sw_displaytarget(dt);
if (whandle->type == WINSYS_HANDLE_TYPE_SHMID) {
if (dri_sw_dt->shmid < 0)
return FALSE;
whandle->handle = dri_sw_dt->shmid;
return TRUE;
}
return FALSE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment