@ -849,6 +849,58 @@ static const struct of_device_id adreno_match_table[] = {
{ }
} ;
static void adreno_of_get_ca_target_pwrlevel ( struct adreno_device * adreno_dev ,
struct device_node * node )
{
struct kgsl_device * device = KGSL_DEVICE ( adreno_dev ) ;
unsigned int ca_target_pwrlevel = 1 ;
of_property_read_u32 ( node , " qcom,ca-target-pwrlevel " ,
& ca_target_pwrlevel ) ;
if ( ca_target_pwrlevel > device - > pwrctrl . num_pwrlevels - 2 )
ca_target_pwrlevel = 1 ;
device - > pwrscale . ctxt_aware_target_pwrlevel = ca_target_pwrlevel ;
}
static void adreno_of_get_ca_aware_properties ( struct adreno_device * adreno_dev ,
struct device_node * parent )
{
struct kgsl_device * device = KGSL_DEVICE ( adreno_dev ) ;
struct kgsl_pwrscale * pwrscale = & device - > pwrscale ;
struct device_node * node , * child ;
unsigned int bin = 0 ;
pwrscale - > ctxt_aware_enable =
of_property_read_bool ( parent , " qcom,enable-ca-jump " ) ;
if ( pwrscale - > ctxt_aware_enable ) {
if ( of_property_read_u32 ( parent , " qcom,ca-busy-penalty " ,
& pwrscale - > ctxt_aware_busy_penalty ) )
pwrscale - > ctxt_aware_busy_penalty = 12000 ;
node = of_find_node_by_name ( parent , " qcom,gpu-pwrlevel-bins " ) ;
if ( node = = NULL ) {
adreno_of_get_ca_target_pwrlevel ( adreno_dev , parent ) ;
return ;
}
for_each_child_of_node ( node , child ) {
if ( of_property_read_u32 ( child , " qcom,speed-bin " , & bin ) )
continue ;
if ( bin = = adreno_dev - > speed_bin ) {
adreno_of_get_ca_target_pwrlevel ( adreno_dev ,
child ) ;
return ;
}
}
pwrscale - > ctxt_aware_target_pwrlevel = 1 ;
}
}
static int adreno_of_parse_pwrlevels ( struct adreno_device * adreno_dev ,
struct device_node * node )
{
@ -1018,6 +1070,9 @@ static int adreno_of_get_power(struct adreno_device *adreno_dev,
if ( adreno_of_get_pwrlevels ( adreno_dev , node ) )
return - EINVAL ;
/* Get context aware DCVS properties */
adreno_of_get_ca_aware_properties ( adreno_dev , node ) ;
/* get pm-qos-active-latency, set it to default if not found */
if ( of_property_read_u32 ( node , " qcom,pm-qos-active-latency " ,
& device - > pwrctrl . pm_qos_active_latency ) )