File tri.c changed (mode: 100644) (index e4aee49..fec6dbe) |
27 |
27 |
#include <alga/amd/dce6/dce6.h> |
#include <alga/amd/dce6/dce6.h> |
28 |
28 |
#include <alga/amd/si/ioctl.h> |
#include <alga/amd/si/ioctl.h> |
29 |
29 |
#include <alga/amd/si/pkt.h> |
#include <alga/amd/si/pkt.h> |
30 |
|
#include <alga/amd/si/regs_cfg.h> |
|
31 |
|
#include <alga/amd/si/regs_sh.h> |
|
32 |
|
#include <alga/amd/si/regs_ctx.h> |
|
|
30 |
|
#include <alga/amd/si/cps_regs.h> |
|
31 |
|
#include <alga/amd/si/gpu_regs_cfg.h> |
|
32 |
|
#include <alga/amd/si/gpu_regs_sh.h> |
|
33 |
|
#include <alga/amd/si/gpu_regs_ctx.h> |
33 |
34 |
|
|
34 |
35 |
static uint32_t set(uint32_t mask,uint32_t v) |
static uint32_t set(uint32_t mask,uint32_t v) |
35 |
36 |
{ |
{ |
|
... |
... |
int main(int argc, char *argv[]) |
1064 |
1065 |
|
|
1065 |
1066 |
//---------------------------------------------------------------------------- |
//---------------------------------------------------------------------------- |
1066 |
1067 |
o("running the ib..."); |
o("running the ib..."); |
1067 |
|
struct si_gfx_ib gfx_ib; |
|
1068 |
|
struct si_timeout_info *ring_t_info=&gfx_ib.ring_t_info; |
|
|
1068 |
|
struct si_gpu_3d_ib gpu_3d_ib; |
|
1069 |
|
struct si_timeout_info *ring_t_info=&gpu_3d_ib.ring_t_info; |
1069 |
1070 |
//we don't really care here lets put one seconde! |
//we don't really care here lets put one seconde! |
1070 |
1071 |
ring_t_info->n_max=1; |
ring_t_info->n_max=1; |
1071 |
1072 |
ring_t_info->us=1000000; |
ring_t_info->us=1000000; |
1072 |
|
gfx_ib.gpu_addr=mem.gpu_addr+ib_of; |
|
1073 |
|
gfx_ib.dws_n=ib_dws_n; |
|
1074 |
|
req=_IOW('d',SI_GFX_IB,gfx_ib); |
|
|
1073 |
|
gpu_3d_ib.gpu_addr=mem.gpu_addr+ib_of; |
|
1074 |
|
gpu_3d_ib.dws_n=ib_dws_n; |
|
1075 |
|
req=_IOW('d',SI_GPU_3D_IB,gpu_3d_ib); |
1075 |
1076 |
errno=0; |
errno=0; |
1076 |
|
r1=ioctl(f,req,&gfx_ib); |
|
|
1077 |
|
r1=ioctl(f,req,&gpu_3d_ib); |
1077 |
1078 |
switch(r1){ |
switch(r1){ |
1078 |
1079 |
case -1: |
case -1: |
1079 |
|
e("running the GFX indirecting buffer failed:%s",strerror(errno)); |
|
|
1080 |
|
e("running the GPU_3D indirecting buffer failed:%s",strerror(errno)); |
1080 |
1081 |
r0=EXIT_FAILURE; |
r0=EXIT_FAILURE; |
1081 |
1082 |
goto free_vram_buf; |
goto free_vram_buf; |
1082 |
1083 |
case SI_RING_TIMEOUT: |
case SI_RING_TIMEOUT: |
1083 |
|
e("running the GFX indirecting buffer failed:ring timeout"); |
|
|
1084 |
|
e("running the GPU_3D indirecting buffer failed:ring timeout"); |
1084 |
1085 |
r0=EXIT_FAILURE; |
r0=EXIT_FAILURE; |
1085 |
1086 |
goto free_vram_buf; |
goto free_vram_buf; |
1086 |
1087 |
} |
} |
|
... |
... |
int main(int argc, char *argv[]) |
1089 |
1090 |
|
|
1090 |
1091 |
//---------------------------------------------------------------------------- |
//---------------------------------------------------------------------------- |
1091 |
1092 |
o("fencing..."); |
o("fencing..."); |
1092 |
|
struct si_gfx_fence gfx_fence; |
|
1093 |
|
t_info=&gfx_fence.t_info; |
|
|
1093 |
|
struct si_gpu_3d_fence gpu_3d_fence; |
|
1094 |
|
t_info=&gpu_3d_fence.t_info; |
1094 |
1095 |
//we don't really care here lets put one seconde! |
//we don't really care here lets put one seconde! |
1095 |
1096 |
t_info->ring.n_max=1; |
t_info->ring.n_max=1; |
1096 |
1097 |
t_info->ring.us=1000000; |
t_info->ring.us=1000000; |
1097 |
1098 |
t_info->fence.n_max=1; |
t_info->fence.n_max=1; |
1098 |
1099 |
t_info->fence.us=1000000; |
t_info->fence.us=1000000; |
1099 |
|
req=_IOW('d',SI_GFX_FENCE,gfx_fence); |
|
|
1100 |
|
req=_IOW('d',SI_GPU_3D_FENCE,gpu_3d_fence); |
1100 |
1101 |
errno=0; |
errno=0; |
1101 |
|
r1=ioctl(f,req,&gfx_fence); |
|
|
1102 |
|
r1=ioctl(f,req,&gpu_3d_fence); |
1102 |
1103 |
switch(r1){ |
switch(r1){ |
1103 |
1104 |
case -1: |
case -1: |
1104 |
1105 |
e("waiting for fence failed:%s",strerror(errno)); |
e("waiting for fence failed:%s",strerror(errno)); |