|
Packit Service |
9402ce |
/*
|
|
Packit Service |
9402ce |
* Copyright (c) 2012 Intel Corporation. All Rights Reserved.
|
|
Packit Service |
9402ce |
*
|
|
Packit Service |
9402ce |
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
Packit Service |
9402ce |
* copy of this software and associated documentation files (the
|
|
Packit Service |
9402ce |
* "Software"), to deal in the Software without restriction, including
|
|
Packit Service |
9402ce |
* without limitation the rights to use, copy, modify, merge, publish,
|
|
Packit Service |
9402ce |
* distribute, sub license, and/or sell copies of the Software, and to
|
|
Packit Service |
9402ce |
* permit persons to whom the Software is furnished to do so, subject to
|
|
Packit Service |
9402ce |
* the following conditions:
|
|
Packit Service |
9402ce |
*
|
|
Packit Service |
9402ce |
* The above copyright notice and this permission notice (including the
|
|
Packit Service |
9402ce |
* next paragraph) shall be included in all copies or substantial portions
|
|
Packit Service |
9402ce |
* of the Software.
|
|
Packit Service |
9402ce |
*
|
|
Packit Service |
9402ce |
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
Packit Service |
9402ce |
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
Packit Service |
9402ce |
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
|
|
Packit Service |
9402ce |
* IN NO EVENT SHALL PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR
|
|
Packit Service |
9402ce |
* ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
Packit Service |
9402ce |
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
|
Packit Service |
9402ce |
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
Packit Service |
9402ce |
*/
|
|
Packit Service |
9402ce |
#ifndef _VA_DRICOMMON_H_
|
|
Packit Service |
9402ce |
#define _VA_DRICOMMON_H_
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
#ifndef ANDROID
|
|
Packit Service |
9402ce |
#include <X11/Xlib.h>
|
|
Packit Service |
9402ce |
#include <xf86drm.h>
|
|
Packit Service |
9402ce |
#include <drm.h>
|
|
Packit Service |
9402ce |
#include <drm_sarea.h>
|
|
Packit Service |
9402ce |
#endif
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
#include <va/va_backend.h>
|
|
Packit Service |
9402ce |
#include <va/va_drmcommon.h>
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
#ifdef ANDROID
|
|
Packit Service |
9402ce |
#define XID unsigned int
|
|
Packit Service |
9402ce |
#define Bool int
|
|
Packit Service |
9402ce |
#endif
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
enum {
|
|
Packit Service |
9402ce |
/* Compatibility. Do not use for newly-written code. */
|
|
Packit Service |
9402ce |
VA_NONE = VA_DRM_AUTH_NONE,
|
|
Packit Service |
9402ce |
VA_DRI1 = VA_DRM_AUTH_DRI1,
|
|
Packit Service |
9402ce |
VA_DRI2 = VA_DRM_AUTH_DRI2,
|
|
Packit Service |
9402ce |
VA_DUMMY = VA_DRM_AUTH_CUSTOM
|
|
Packit Service |
9402ce |
};
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
union dri_buffer
|
|
Packit Service |
9402ce |
{
|
|
Packit Service |
9402ce |
struct {
|
|
Packit Service |
9402ce |
unsigned int attachment;
|
|
Packit Service |
9402ce |
unsigned int name;
|
|
Packit Service |
9402ce |
unsigned int pitch;
|
|
Packit Service |
9402ce |
unsigned int cpp;
|
|
Packit Service |
9402ce |
unsigned int flags;
|
|
Packit Service |
9402ce |
/** \brief Reserved bytes for future use, must be zero */
|
|
Packit Service |
9402ce |
unsigned int va_reserved[8];
|
|
Packit Service |
9402ce |
} dri2;
|
|
Packit Service |
9402ce |
};
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
struct dri_drawable
|
|
Packit Service |
9402ce |
{
|
|
Packit Service |
9402ce |
XID x_drawable;
|
|
Packit Service |
9402ce |
int is_window;
|
|
Packit Service |
9402ce |
int x;
|
|
Packit Service |
9402ce |
int y;
|
|
Packit Service |
9402ce |
unsigned int width;
|
|
Packit Service |
9402ce |
unsigned int height;
|
|
Packit Service |
9402ce |
struct dri_drawable *next;
|
|
Packit Service |
9402ce |
};
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
#define DRAWABLE_HASH_SZ 32
|
|
Packit Service |
9402ce |
struct dri_state
|
|
Packit Service |
9402ce |
{
|
|
Packit Service |
9402ce |
struct drm_state base;
|
|
Packit Service |
9402ce |
#ifndef ANDROID
|
|
Packit Service |
9402ce |
struct dri_drawable *drawable_hash[DRAWABLE_HASH_SZ];
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
struct dri_drawable *(*createDrawable)(VADriverContextP ctx, XID x_drawable);
|
|
Packit Service |
9402ce |
void (*destroyDrawable)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
|
|
Packit Service |
9402ce |
void (*swapBuffer)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
|
|
Packit Service |
9402ce |
union dri_buffer *(*getRenderingBuffer)(VADriverContextP ctx, struct dri_drawable *dri_drawable);
|
|
Packit Service |
9402ce |
void (*close)(VADriverContextP ctx);
|
|
Packit Service |
9402ce |
#endif
|
|
Packit Service |
9402ce |
/** \brief Reserved bytes for future use, must be zero */
|
|
Packit Service |
9402ce |
unsigned long va_reserved[16];
|
|
Packit Service |
9402ce |
};
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
Bool va_isDRI2Connected(VADriverContextP ctx, char **driver_name);
|
|
Packit Service |
9402ce |
void va_dri_free_drawable(VADriverContextP ctx, struct dri_drawable* dri_drawable);
|
|
Packit Service |
9402ce |
void va_dri_free_drawable_hashtable(VADriverContextP ctx);
|
|
Packit Service |
9402ce |
struct dri_drawable *va_dri_get_drawable(VADriverContextP ctx, XID drawable);
|
|
Packit Service |
9402ce |
void va_dri_swap_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable);
|
|
Packit Service |
9402ce |
union dri_buffer *va_dri_get_rendering_buffer(VADriverContextP ctx, struct dri_drawable *dri_drawable);
|
|
Packit Service |
9402ce |
|
|
Packit Service |
9402ce |
#endif /* _VA_DRICOMMON_H_ */
|