@@ -849,9 +849,16 @@ static void a6xx_set_ubwc_config(struct msm_gpu *gpu)
849849 min_acc_len_64b << 3 |
850850 hbb_lo << 1 | ubwc_mode );
851851
852- if (adreno_is_a7xx (adreno_gpu ))
853- gpu_write (gpu , REG_A7XX_GRAS_NC_MODE_CNTL ,
854- FIELD_PREP (GENMASK (8 , 5 ), hbb_lo ));
852+ if (adreno_is_a7xx (adreno_gpu )) {
853+ for (u32 pipe_id = PIPE_BR ; pipe_id <= PIPE_BV ; pipe_id ++ ) {
854+ gpu_write (gpu , REG_A7XX_CP_APERTURE_CNTL_HOST ,
855+ A7XX_CP_APERTURE_CNTL_HOST_PIPE (pipe_id ));
856+ gpu_write (gpu , REG_A7XX_GRAS_NC_MODE_CNTL ,
857+ FIELD_PREP (GENMASK (8 , 5 ), hbb_lo ));
858+ }
859+ gpu_write (gpu , REG_A7XX_CP_APERTURE_CNTL_HOST ,
860+ A7XX_CP_APERTURE_CNTL_HOST_PIPE (PIPE_NONE ));
861+ }
855862
856863 gpu_write (gpu , REG_A6XX_UCHE_MODE_CNTL ,
857864 min_acc_len_64b << 23 | hbb_lo << 21 );
@@ -865,23 +872,27 @@ static void a7xx_patch_pwrup_reglist(struct msm_gpu *gpu)
865872 struct adreno_gpu * adreno_gpu = to_adreno_gpu (gpu );
866873 struct a6xx_gpu * a6xx_gpu = to_a6xx_gpu (adreno_gpu );
867874 const struct adreno_reglist_list * reglist ;
875+ const struct adreno_reglist_pipe_list * dyn_pwrup_reglist ;
868876 void * ptr = a6xx_gpu -> pwrup_reglist_ptr ;
869877 struct cpu_gpu_lock * lock = ptr ;
870878 u32 * dest = (u32 * )& lock -> regs [0 ];
879+ u32 dyn_pwrup_reglist_count = 0 ;
871880 int i ;
872881
873882 lock -> gpu_req = lock -> cpu_req = lock -> turn = 0 ;
874883
875884 reglist = adreno_gpu -> info -> a6xx -> ifpc_reglist ;
876- lock -> ifpc_list_len = reglist -> count ;
885+ if (reglist ) {
886+ lock -> ifpc_list_len = reglist -> count ;
877887
878- /*
879- * For each entry in each of the lists, write the offset and the current
880- * register value into the GPU buffer
881- */
882- for (i = 0 ; i < reglist -> count ; i ++ ) {
883- * dest ++ = reglist -> regs [i ];
884- * dest ++ = gpu_read (gpu , reglist -> regs [i ]);
888+ /*
889+ * For each entry in each of the lists, write the offset and the current
890+ * register value into the GPU buffer
891+ */
892+ for (i = 0 ; i < reglist -> count ; i ++ ) {
893+ * dest ++ = reglist -> regs [i ];
894+ * dest ++ = gpu_read (gpu , reglist -> regs [i ]);
895+ }
885896 }
886897
887898 reglist = adreno_gpu -> info -> a6xx -> pwrup_reglist ;
@@ -907,7 +918,24 @@ static void a7xx_patch_pwrup_reglist(struct msm_gpu *gpu)
907918 * (<aperture, shifted 12 bits> <address> <data>), and the length is
908919 * stored as number for triplets in dynamic_list_len.
909920 */
910- lock -> dynamic_list_len = 0 ;
921+ dyn_pwrup_reglist = adreno_gpu -> info -> a6xx -> dyn_pwrup_reglist ;
922+ if (dyn_pwrup_reglist ) {
923+ for (u32 pipe_id = PIPE_BR ; pipe_id <= PIPE_BV ; pipe_id ++ ) {
924+ gpu_write (gpu , REG_A7XX_CP_APERTURE_CNTL_HOST ,
925+ A7XX_CP_APERTURE_CNTL_HOST_PIPE (pipe_id ));
926+ for (i = 0 ; i < dyn_pwrup_reglist -> count ; i ++ ) {
927+ if ((dyn_pwrup_reglist -> regs [i ].pipe & BIT (pipe_id )) == 0 )
928+ continue ;
929+ * dest ++ = A7XX_CP_APERTURE_CNTL_HOST_PIPE (pipe_id );
930+ * dest ++ = dyn_pwrup_reglist -> regs [i ].offset ;
931+ * dest ++ = gpu_read (gpu , dyn_pwrup_reglist -> regs [i ].offset );
932+ dyn_pwrup_reglist_count ++ ;
933+ }
934+ }
935+ gpu_write (gpu , REG_A7XX_CP_APERTURE_CNTL_HOST ,
936+ A7XX_CP_APERTURE_CNTL_HOST_PIPE (PIPE_NONE ));
937+ }
938+ lock -> dynamic_list_len = dyn_pwrup_reglist_count ;
911939}
912940
913941static int a7xx_preempt_start (struct msm_gpu * gpu )
0 commit comments