sna: Print detected CPU features
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
528dbf9ebb
commit
13461a18b1
|
|
@ -868,6 +868,7 @@ inline static bool is_clipped(const RegionRec *r,
|
|||
}
|
||||
|
||||
unsigned sna_cpu_detect(void);
|
||||
char *sna_cpu_features_to_string(unsigned features, char *line);
|
||||
|
||||
void sna_threads_init(void);
|
||||
int sna_use_threads (int width, int height, int threshold);
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ unsigned sna_cpu_detect(void)
|
|||
unsigned int eax, ebx, ecx, edx;
|
||||
unsigned features = 0;
|
||||
|
||||
__cpuid(0, eax, ebx, ecx, edx);
|
||||
__cpuid(1, eax, ebx, ecx, edx);
|
||||
|
||||
if (eax & bit_SSE3)
|
||||
features |= SSE3;
|
||||
|
|
@ -89,3 +89,27 @@ unsigned sna_cpu_detect(void)
|
|||
}
|
||||
|
||||
#endif
|
||||
|
||||
char *sna_cpu_features_to_string(unsigned features, char *line)
|
||||
{
|
||||
char *ret = line;
|
||||
|
||||
if (features & SSE2)
|
||||
line += sprintf (line, ", sse2");
|
||||
if (features & SSE3)
|
||||
line += sprintf (line, ", sse3");
|
||||
if (features & SSSE3)
|
||||
line += sprintf (line, ", ssse3");
|
||||
if (features & SSE4a)
|
||||
line += sprintf (line, ", sse4a");
|
||||
if (features & SSE4_1)
|
||||
line += sprintf (line, ", sse4.1");
|
||||
if (features & SSE4_2)
|
||||
line += sprintf (line, ", sse4.2");
|
||||
if (features & AVX)
|
||||
line += sprintf (line, ", avx");
|
||||
if (features & AVX2)
|
||||
line += sprintf (line, ", avx2");
|
||||
|
||||
return ret + 2;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -451,6 +451,7 @@ static Bool sna_option_cast_to_bool(struct sna *sna, int id, Bool val)
|
|||
static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
|
||||
{
|
||||
struct sna *sna;
|
||||
char buf[1024];
|
||||
rgb defaultWeight = { 0, 0, 0 };
|
||||
EntityInfoPtr pEnt;
|
||||
int preferred_depth;
|
||||
|
|
@ -582,6 +583,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
|
|||
if (xf86ReturnOptValBool(sna->Options, OPTION_CRTC_PIXMAPS, FALSE))
|
||||
sna->flags |= SNA_FORCE_SHADOW;
|
||||
|
||||
xf86DrvMsg(scrn->scrnIndex, X_PROBED, "CPU: %s\n",
|
||||
sna_cpu_features_to_string(sna->cpu_features, buf));
|
||||
xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Framebuffer %s\n",
|
||||
sna->tiling & SNA_TILING_FB ? "tiled" : "linear");
|
||||
xf86DrvMsg(scrn->scrnIndex, X_CONFIG, "Pixmaps %s\n",
|
||||
|
|
|
|||
Loading…
Reference in New Issue