Yiwei Zhang | 544d6b3 | 2019-02-07 15:00:55 -0800 | [diff] [blame] | 1 | # gpuservice - server for gpu stats and other gpu related services |
| 2 | typeattribute gpuservice coredomain; |
Peiyong Lin | 7924dc6 | 2018-11-01 13:47:51 -0700 | [diff] [blame] | 3 | type gpuservice_exec, system_file_type, exec_type, file_type; |
| 4 | |
| 5 | init_daemon_domain(gpuservice) |
| 6 | |
| 7 | binder_call(gpuservice, adbd) |
| 8 | binder_call(gpuservice, shell) |
| 9 | binder_use(gpuservice) |
| 10 | |
| 11 | # Access the GPU. |
| 12 | allow gpuservice gpu_device:chr_file rw_file_perms; |
| 13 | |
| 14 | # GPU service will need to load GPU driver, for example Vulkan driver in order |
| 15 | # to get the capability of the driver. |
| 16 | allow gpuservice same_process_hal_file:file { open read getattr execute map }; |
| 17 | allow gpuservice ion_device:chr_file r_file_perms; |
| 18 | get_prop(gpuservice, hwservicemanager_prop) |
| 19 | hwbinder_use(gpuservice) |
| 20 | |
| 21 | # Access /dev/graphics/fb0. |
| 22 | allow gpuservice graphics_device:dir search; |
| 23 | allow gpuservice graphics_device:chr_file rw_file_perms; |
| 24 | |
Yiwei Zhang | ff0f79c | 2018-11-27 15:21:43 -0800 | [diff] [blame] | 25 | # Needed for dumpsys pipes. |
| 26 | allow gpuservice shell:fifo_file write; |
| 27 | |
Peiyong Lin | 7924dc6 | 2018-11-01 13:47:51 -0700 | [diff] [blame] | 28 | # Use socket supplied by adbd, for cmd gpu vkjson etc. |
| 29 | allow gpuservice adbd:unix_stream_socket { read write getattr }; |
| 30 | |
Yiwei Zhang | 6e8191e | 2019-01-23 14:28:56 -0800 | [diff] [blame] | 31 | # Needed for interactive shell |
| 32 | allow gpuservice devpts:chr_file { read write getattr }; |
| 33 | |
Yiwei Zhang | 0051c93 | 2019-05-09 23:15:49 -0700 | [diff] [blame] | 34 | # Needed for dumpstate to dumpsys gpu. |
| 35 | allow gpuservice dumpstate:fd use; |
| 36 | allow gpuservice dumpstate:fifo_file write; |
| 37 | |
Yiwei Zhang | dbbe3bd | 2020-02-04 15:55:59 -0800 | [diff] [blame^] | 38 | # Needed for stats callback registration to statsd. |
| 39 | allow gpuservice stats_service:service_manager find; |
| 40 | binder_call(gpuservice, statsd); |
| 41 | |
Peiyong Lin | 7924dc6 | 2018-11-01 13:47:51 -0700 | [diff] [blame] | 42 | add_service(gpuservice, gpu_service) |
| 43 | |
| 44 | # Only uncomment below line when in development |
| 45 | # userdebug_or_eng(`permissive gpuservice;') |