summaryrefslogtreecommitdiff
path: root/dri.h
blob: ffdd2e85645ec9c16139eaf6a7501aae6342b174 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
 * Copyright 2017 Advanced Micro Devices. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */

#ifndef MINIGBM_DRI_H
#define MINIGBM_DRI_H

// clang-format off

/* for GLboolean */
#include "GL/gl.h"

#include "GL/internal/dri_interface.h"

struct bo;
struct driver;
struct vma;

struct drv_import_fd_data;

struct dri_driver_priv {
	void *driver_handle;
	__DRIscreen *device;
	__DRIcontext *context; /* used for map/unmap operations */
	const __DRIextension **extensions;
	const __DRIcoreExtension *core_extension;
	const __DRIdri2Extension *dri2_extension;
	const __DRIimageExtension *image_extension;
	const __DRIconfig **configs;
};


int dri_init(struct driver *drv, const char *dri_so_path, const char *driver_suffix);
void dri_close(struct driver *drv);
int dri_bo_create(struct bo *bo, uint32_t width, uint32_t height, uint32_t format,
		  uint64_t use_flags);
int dri_bo_import(struct bo *bo, struct drv_import_fd_data *data);
int dri_bo_destroy(struct bo *bo);
void *dri_bo_map(struct bo *bo, struct vma *vma, size_t plane, uint32_t map_flags);
int dri_bo_unmap(struct bo *bo, struct vma *vma);

#endif