blob: d01bc5d54577850a825e397ea214988ffd9b84a3 [file] [log] [blame]
Satyajitcdcebd82018-01-12 14:49:05 +05301/*
2 * Copyright 2017 Advanced Micro Devices. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the LICENSE file.
5 */
6
7#ifdef DRV_AMDGPU
8
9typedef int GLint;
10typedef unsigned int GLuint;
11typedef unsigned char GLboolean;
12
13#include "GL/internal/dri_interface.h"
14#include "drv.h"
15
16struct dri_driver {
17 void *driver_handle;
18 __DRIscreen *device;
19 __DRIcontext *context; /* Needed for map/unmap operations. */
20 const __DRIextension **extensions;
21 const __DRIcoreExtension *core_extension;
22 const __DRIdri2Extension *dri2_extension;
23 const __DRIimageExtension *image_extension;
24 const __DRI2flushExtension *flush_extension;
25 const __DRIconfig **configs;
26};
27
28int dri_init(struct driver *drv, const char *dri_so_path, const char *driver_suffix);
29void dri_close(struct driver *drv);
30int dri_bo_create(struct bo *bo, uint32_t width, uint32_t height, uint32_t format,
31 uint64_t use_flags);
32int dri_bo_import(struct bo *bo, struct drv_import_fd_data *data);
33int dri_bo_destroy(struct bo *bo);
34void *dri_bo_map(struct bo *bo, struct vma *vma, size_t plane, uint32_t map_flags);
35int dri_bo_unmap(struct bo *bo, struct vma *vma);
36
37#endif