From 379de5a9b0329f28e2b194cfb49ecb5715194295 Mon Sep 17 00:00:00 2001 From: Zhongchao Xia Date: Sat, 18 Jan 2020 10:12:32 +0800 Subject: [PATCH] [ALPS04382560] MDP: open mdp device fail [Detail] 1. Change /proc/mdp/device to /dev/mdp_device 2. Modify kernel driver change device node 3. Modify init.rc change device owner 4. Add selinux policy MTK-Commit-Id: 08cf6d6ee97647a5f1262f475b79b420b616e527 Change-Id: I2bd7ee983116294dd62f247a9d30a67655316bd8 CR-Id: ALPS04382560 Feature: [Module]MDP Driver --- non_plat/app.te | 4 ++++ non_plat/device.te | 1 + non_plat/file_contexts | 1 + non_plat/hal_graphics_composer_default.te | 4 ++++ non_plat/surfaceflinger.te | 10 ++++++++++ 5 files changed, 20 insertions(+) diff --git a/non_plat/app.te b/non_plat/app.te index a3b2195..75950a3 100644 --- a/non_plat/app.te +++ b/non_plat/app.te @@ -35,3 +35,7 @@ allowxperm appdomain proc_perfmgr:file ioctl { FPSGO_QUEUE_CONNECT FPSGO_BQID }; + +# Date : W19.4 +# Purpose : Allow MDP user access mdp driver +allow appdomain mdp_device:chr_file rw_file_perms; diff --git a/non_plat/device.te b/non_plat/device.te index 638ef5d..3f543dd 100644 --- a/non_plat/device.te +++ b/non_plat/device.te @@ -226,6 +226,7 @@ type boot_para_block_device,dev_type; type mtk_dfrc_device, dev_type; type vbmeta_block_device, dev_type; type alarm_device, dev_type; +type mdp_device, dev_type; ########################## # Sensor common Devices Start diff --git a/non_plat/file_contexts b/non_plat/file_contexts index 5451ec4..0eb21b7 100644 --- a/non_plat/file_contexts +++ b/non_plat/file_contexts @@ -207,6 +207,7 @@ /dev/mtk_sched(/.*)? u:object_r:mtk_sched_device:s0 /dev/MTK_SMI(/.*)? u:object_r:MTK_SMI_device:s0 /dev/mtk_cmdq(/.*)? u:object_r:mtk_cmdq_device:s0 +/dev/mdp_device(/.*)? u:object_r:mdp_device:s0 /dev/mdp_sync(/.*)? u:object_r:mtk_mdp_device:s0 /dev/mtk_rrc(/.*)? u:object_r:mtk_rrc_device:s0 /dev/mtk_dfrc(/.*)? u:object_r:mtk_dfrc_device:s0 diff --git a/non_plat/hal_graphics_composer_default.te b/non_plat/hal_graphics_composer_default.te index e2e5781..1c1f320 100644 --- a/non_plat/hal_graphics_composer_default.te +++ b/non_plat/hal_graphics_composer_default.te @@ -50,6 +50,10 @@ set_prop(hal_graphics_composer_default, graphics_hwc_latch_unsignaled_prop) #============= hal_graphics_composer_default ============== allow hal_graphics_composer_default mtk_mdp_device:chr_file { read write open ioctl }; +allow hal_graphics_composer_default mdp_device:chr_file rw_file_perms; + +allow hal_graphics_composer_default tee_device:chr_file rw_file_perms; + allowxperm hal_graphics_composer_default proc_ged:file ioctl { GED_BRIDGE_IO_LOG_BUF_GET GED_BRIDGE_IO_GE_INFO diff --git a/non_plat/surfaceflinger.te b/non_plat/surfaceflinger.te index fca1b5c..e51aaba 100644 --- a/non_plat/surfaceflinger.te +++ b/non_plat/surfaceflinger.te @@ -81,3 +81,13 @@ GED_BRIDGE_IO_IOCTLCMD_0F GED_BRIDGE_IO_IOCTLCMD_10 GED_BRIDGE_IO_MONITOR_3D_FENCE }; + +# Date : WK19.4 +# Operation : P Migration +# Purpose: Allow to access /dev/mdp_device driver +allow surfaceflinger mdp_device:chr_file rw_file_perms; + +# Date : WK19.09 +# Purpose: Allow to access property dev/mdp_sync +#============= surfaceflinger ============== +allow surfaceflinger mtk_mdp_device:chr_file rw_file_perms;