sylware / si-user (public) (License: Unspecified) (since 2019-09-09) (hash sha1)
old sample user level code to go with my gpu driver (has interesting code)
List of commits:
Subject Hash Author Date (UTC)
better UAPI naming 68e750f17d4256bef0e890d03b6dfc5612bd41d8 Sylvain BERTRAND 2013-10-23 04:58:26
use of simpler userland API e7f555a4d2ab2944efcae0c840c19a1cec929325 Sylvain BERTRAND 2013-09-20 11:16:15
timeouts in userspace a9dcf2e0c1e8d1601305a4afd47e09a7a4aff748 Sylvain BERTRAND 2013-09-01 21:27:20
use monotonic raw timespec for page flipping aa5758c53e6a58038013c7be87a1ba865cb9b3df Sylvain BERTRAND 2013-08-31 02:48:33
pf is now asynchronous 246114120ed41152e5cc551ff28da99cac20d470 Sylvain BERTRAND 2013-08-28 00:16:17
memory caches love c51aedf797f97ec3426511b1578e52d575f25321 Sylvain BERTRAND 2013-08-23 14:48:06
add files 28fe912c85541ca80777d87fc4ac21447e9d57d0 Sylvain BERTRAND 2013-08-23 13:44:21
Initial commit 18d8ad18c54c32f78561e26d949d58efb8483bd3 Sylvain BERTRAND 2013-08-23 12:50:05
Commit 68e750f17d4256bef0e890d03b6dfc5612bd41d8 - better UAPI naming
Author: Sylvain BERTRAND
Author date (UTC): 2013-10-23 04:58
Committer name: Sylvain BERTRAND
Committer date (UTC): 2013-10-23 04:58
Parent(s): e7f555a4d2ab2944efcae0c840c19a1cec929325
Signer:
Signing key:
Signing status: N
Tree: 85f123b9f7417383aa9fb299a99abdf7a23a43a9
File Lines added Lines deleted
tri.c 16 15
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));
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/sylware/si-user

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/sylware/si-user

Clone this repository using git:
git clone git://git.rocketgit.com/user/sylware/si-user

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main