[PART1 PATCH 2/8] drm/amdgpu: add parse clock gating state

Huang Rui ray.huang at amd.com
Fri Jan 6 06:19:57 UTC 2017


On Thu, Jan 05, 2017 at 11:33:38AM -0500, Felix Kuehling wrote:
> This could be done with much less code duplication:
> 
> 	static const struct {
> 		u32 flag;
> 		const char *name;
> 	} clocks[] = {
> 		{AMD_CG_SUPPORT_GFX_MGCG, "Medium Grain Clock Gating"},
> 		{AMD_CG_SUPPORT_GFX_MGLS, "Medium Grain memory Light Sleep"},
> 		...
> 		{0, NULL}
> 	};
> 
> 	for (i = 0; clocks[i].flag; i++)
> 		seq_printf(m, "\t%s: %s\n",
> 			clocks[i].name,
> 			(flags & clocks[i].flag) ? "On" : "Off");
> 

Looks better. Thank you.

Thanks,
Rui


More information about the amd-gfx mailing list