Back to index

libdrm  2.4.37
radeon_bo.h
Go to the documentation of this file.
00001 /*
00002  * Copyright © 2008 Jérôme Glisse
00003  * All Rights Reserved.
00004  *
00005  * Permission is hereby granted, free of charge, to any person obtaining
00006  * a copy of this software and associated documentation files (the
00007  * "Software"), to deal in the Software without restriction, including
00008  * without limitation the rights to use, copy, modify, merge, publish,
00009  * distribute, sub license, and/or sell copies of the Software, and to
00010  * permit persons to whom the Software is furnished to do so, subject to
00011  * the following conditions:
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
00014  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
00015  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
00016  * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS
00017  * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00018  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
00019  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
00020  * USE OR OTHER DEALINGS IN THE SOFTWARE.
00021  *
00022  * The above copyright notice and this permission notice (including the
00023  * next paragraph) shall be included in all copies or substantial portions
00024  * of the Software.
00025  */
00026 /*
00027  * Authors:
00028  *      Jérôme Glisse <glisse@freedesktop.org>
00029  */
00030 #ifndef RADEON_BO_H
00031 #define RADEON_BO_H
00032 
00033 #include <stdio.h>
00034 #include <stdint.h>
00035 
00036 /* bo object */
00037 #define RADEON_BO_FLAGS_MACRO_TILE  1
00038 #define RADEON_BO_FLAGS_MICRO_TILE  2
00039 #define RADEON_BO_FLAGS_MICRO_TILE_SQUARE 0x20
00040 
00041 struct radeon_bo_manager;
00042 struct radeon_cs;
00043 
00044 struct radeon_bo {
00045     void                        *ptr;
00046     uint32_t                    flags;
00047     uint32_t                    handle;
00048     uint32_t                    size;
00049 };
00050 
00051 struct radeon_bo_manager;
00052 
00053 void radeon_bo_debug(struct radeon_bo *bo, const char *op);
00054 
00055 struct radeon_bo *radeon_bo_open(struct radeon_bo_manager *bom,
00056                                  uint32_t handle,
00057                                  uint32_t size,
00058                                  uint32_t alignment,
00059                                  uint32_t domains,
00060                                  uint32_t flags);
00061 
00062 void radeon_bo_ref(struct radeon_bo *bo);
00063 struct radeon_bo *radeon_bo_unref(struct radeon_bo *bo);
00064 int radeon_bo_map(struct radeon_bo *bo, int write);
00065 int radeon_bo_unmap(struct radeon_bo *bo);
00066 int radeon_bo_wait(struct radeon_bo *bo);
00067 int radeon_bo_is_busy(struct radeon_bo *bo, uint32_t *domain);
00068 int radeon_bo_set_tiling(struct radeon_bo *bo, uint32_t tiling_flags, uint32_t pitch);
00069 int radeon_bo_get_tiling(struct radeon_bo *bo, uint32_t *tiling_flags, uint32_t *pitch);
00070 int radeon_bo_is_static(struct radeon_bo *bo);
00071 int radeon_bo_is_referenced_by_cs(struct radeon_bo *bo, struct radeon_cs *cs);
00072 uint32_t radeon_bo_get_handle(struct radeon_bo *bo);
00073 uint32_t radeon_bo_get_src_domain(struct radeon_bo *bo);
00074 #endif