af5319efd1fd9f77a34f788d495193f22613431f
2 * Copyright © 2009 Jerome Glisse <glisse@freedesktop.org>
4 * This file is free software; you can redistribute it and/or modify
5 * it under the terms of version 2 of the GNU General Public License
6 * as published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software Foundation,
15 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
22 #include "xf86drmMode.h"
32 typedef int (*radeon_state_pm4_t
)(struct radeon_state
*state
);
33 struct radeon_register
{
40 struct radeon_sub_type
{
42 const struct radeon_register
*regs
;
46 struct radeon_stype_info
{
50 radeon_state_pm4_t pm4
;
51 struct radeon_sub_type reginfo
[R600_SHADER_MAX
];
63 struct radeon_stype_info
*stype
;
66 extern struct radeon
*radeon_new(int fd
, unsigned device
);
67 extern struct radeon
*radeon_incref(struct radeon
*radeon
);
68 extern struct radeon
*radeon_decref(struct radeon
*radeon
);
69 extern unsigned radeon_family_from_device(unsigned device
);
70 extern int radeon_is_family_compatible(unsigned family1
, unsigned family2
);
72 int radeon_ctx_set_bo_new(struct radeon_ctx
*ctx
, struct radeon_bo
*bo
);
73 struct radeon_bo
*radeon_ctx_get_bo(struct radeon_ctx
*ctx
, unsigned reloc
);
74 void radeon_ctx_get_placement(struct radeon_ctx
*ctx
, unsigned reloc
, u32
*placement
);
75 int radeon_ctx_set_draw_new(struct radeon_ctx
*ctx
, struct radeon_draw
*draw
);
76 int radeon_ctx_draw(struct radeon_ctx
*ctx
);
79 * r600/r700 context functions
81 extern int r600_init(struct radeon
*radeon
);
82 extern int r600_ctx_draw(struct radeon_ctx
*ctx
);
83 extern int r600_ctx_next_reloc(struct radeon_ctx
*ctx
, unsigned *reloc
);
86 * radeon state functions
88 extern u32
radeon_state_register_get(struct radeon_state
*state
, unsigned offset
);
89 extern int radeon_state_register_set(struct radeon_state
*state
, unsigned offset
, u32 value
);
90 extern struct radeon_state
*radeon_state_duplicate(struct radeon_state
*state
);
91 extern int radeon_state_replace_always(struct radeon_state
*ostate
, struct radeon_state
*nstate
);
92 extern int radeon_state_pm4_generic(struct radeon_state
*state
);
93 extern int radeon_state_reloc(struct radeon_state
*state
, unsigned id
, unsigned bo_id
);
96 * radeon draw functions
98 extern int radeon_draw_pm4(struct radeon_draw
*draw
);