mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-30 09:33:39 +01:00
Display: report platform api used for detection
This commit is contained in:
@@ -13,7 +13,8 @@ FFDisplayResult* ffdsAppendDisplay(
|
||||
bool primary,
|
||||
uint64_t id,
|
||||
uint32_t physicalWidth,
|
||||
uint32_t physicalHeight)
|
||||
uint32_t physicalHeight,
|
||||
const char* platformApi)
|
||||
{
|
||||
if(width == 0 || height == 0)
|
||||
return NULL;
|
||||
@@ -31,6 +32,7 @@ FFDisplayResult* ffdsAppendDisplay(
|
||||
display->physicalWidth = physicalWidth;
|
||||
display->physicalHeight = physicalHeight;
|
||||
display->primary = primary;
|
||||
display->platformApi = platformApi;
|
||||
|
||||
display->bitDepth = 0;
|
||||
display->hdrStatus = FF_DISPLAY_HDR_STATUS_UNKNOWN;
|
||||
|
||||
@@ -70,6 +70,7 @@ typedef struct FFDisplayResult
|
||||
uint32_t physicalWidth;
|
||||
uint32_t physicalHeight;
|
||||
bool primary;
|
||||
const char* platformApi;
|
||||
uint8_t bitDepth;
|
||||
FFDisplayHdrStatus hdrStatus;
|
||||
uint16_t manufactureYear;
|
||||
@@ -102,4 +103,5 @@ FFDisplayResult* ffdsAppendDisplay(
|
||||
bool primary,
|
||||
uint64_t id,
|
||||
uint32_t physicalWidth,
|
||||
uint32_t physicalHeight);
|
||||
uint32_t physicalHeight,
|
||||
const char* platformApi);
|
||||
|
||||
@@ -66,7 +66,8 @@ static void detectWithDumpsys(FFDisplayServerResult* ds)
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
0,
|
||||
"dumpsys"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,7 +101,8 @@ static bool detectWithGetprop(FFDisplayServerResult* ds)
|
||||
false,
|
||||
0,
|
||||
0,
|
||||
0
|
||||
0,
|
||||
"getprop"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,7 +94,8 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
CGDisplayIsMain(screen),
|
||||
(uint64_t)screen,
|
||||
physicalWidth,
|
||||
physicalHeight
|
||||
physicalHeight,
|
||||
"CoreGraphics"
|
||||
);
|
||||
if (display)
|
||||
{
|
||||
|
||||
@@ -165,7 +165,8 @@ static void detectDisplays(FFDisplayServerResult* ds)
|
||||
!!(monitorInfo->info.dwFlags & MONITORINFOF_PRIMARY),
|
||||
(uint64_t)(uintptr_t) monitorInfo->handle,
|
||||
physicalWidth,
|
||||
physicalHeight
|
||||
physicalHeight,
|
||||
"GDI"
|
||||
);
|
||||
|
||||
if (display)
|
||||
|
||||
@@ -86,7 +86,7 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
|
||||
if (ffSettingsGetFreeBSDKenv("screen.height", &buf))
|
||||
{
|
||||
uint32_t height = (uint32_t) ffStrbufToUInt(&buf, 0);
|
||||
ffdsAppendDisplay(ds, width, height, 0, 0, 0, 0, NULL, FF_DISPLAY_TYPE_UNKNOWN, false, 0, 0, 0);
|
||||
ffdsAppendDisplay(ds, width, height, 0, 0, 0, 0, NULL, FF_DISPLAY_TYPE_UNKNOWN, false, 0, 0, 0, "kenv");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,7 +90,8 @@ static const char* drmParseSysfs(FFDisplayServerResult* result)
|
||||
false,
|
||||
0,
|
||||
physicalWidth,
|
||||
physicalHeight
|
||||
physicalHeight,
|
||||
"sysfs-drm"
|
||||
);
|
||||
if (item && edidLength)
|
||||
{
|
||||
@@ -390,7 +391,8 @@ static const char* drmConnectLibdrm(FFDisplayServerResult* result)
|
||||
false,
|
||||
conn->connector_id,
|
||||
conn->mmWidth,
|
||||
conn->mmHeight
|
||||
conn->mmHeight,
|
||||
"libdrm"
|
||||
);
|
||||
|
||||
if (item)
|
||||
|
||||
@@ -129,7 +129,8 @@ void ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* regist
|
||||
false,
|
||||
display.id,
|
||||
(uint32_t) display.physicalWidth,
|
||||
(uint32_t) display.physicalHeight
|
||||
(uint32_t) display.physicalHeight,
|
||||
"wayland-global"
|
||||
);
|
||||
if (item)
|
||||
{
|
||||
|
||||
@@ -194,7 +194,8 @@ void ffWaylandHandleKdeOutput(WaylandData* wldata, struct wl_registry* registry,
|
||||
false,
|
||||
display.id,
|
||||
(uint32_t) display.physicalWidth,
|
||||
(uint32_t) display.physicalHeight
|
||||
(uint32_t) display.physicalHeight,
|
||||
"wayland-kde"
|
||||
);
|
||||
if (item)
|
||||
{
|
||||
|
||||
@@ -138,7 +138,8 @@ static void waylandHandleZwlrHead(void *data, FF_MAYBE_UNUSED struct zwlr_output
|
||||
false,
|
||||
display.id,
|
||||
(uint32_t) display.physicalWidth,
|
||||
(uint32_t) display.physicalHeight
|
||||
(uint32_t) display.physicalHeight,
|
||||
"wayland-zwlr"
|
||||
);
|
||||
if (item)
|
||||
{
|
||||
|
||||
@@ -118,7 +118,8 @@ const char* ffdsConnectXcb(FFDisplayServerResult* result)
|
||||
false,
|
||||
0,
|
||||
(uint32_t) screen->width_in_millimeters,
|
||||
(uint32_t) screen->height_in_millimeters
|
||||
(uint32_t) screen->height_in_millimeters,
|
||||
"xcb"
|
||||
);
|
||||
ffxcb_screen_next(&iterator);
|
||||
}
|
||||
@@ -239,7 +240,8 @@ static bool xcbRandrHandleCrtc(XcbRandrData* data, xcb_randr_crtc_t crtc, FFstrb
|
||||
primary,
|
||||
0,
|
||||
(uint32_t) output->mm_width,
|
||||
(uint32_t) output->mm_height
|
||||
(uint32_t) output->mm_height,
|
||||
"xcb-randr-crtc"
|
||||
);
|
||||
if (item && edidLength)
|
||||
{
|
||||
@@ -327,7 +329,8 @@ static bool xcbRandrHandleMonitor(XcbRandrData* data, xcb_randr_monitor_info_t*
|
||||
!!monitor->primary,
|
||||
0,
|
||||
(uint32_t) monitor->width_in_millimeters,
|
||||
(uint32_t) monitor->height_in_millimeters
|
||||
(uint32_t) monitor->height_in_millimeters,
|
||||
"xcb-randr-monitor"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -381,7 +384,8 @@ static void xcbRandrHandleScreen(XcbRandrData* data, xcb_screen_t* screen)
|
||||
false,
|
||||
0,
|
||||
(uint32_t) screen->width_in_millimeters,
|
||||
(uint32_t) screen->height_in_millimeters
|
||||
(uint32_t) screen->height_in_millimeters,
|
||||
"xcb-randr-screen"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,8 @@ const char* ffdsConnectXlib(FFDisplayServerResult* result)
|
||||
false,
|
||||
0,
|
||||
(uint32_t) WidthMMOfScreen(screen),
|
||||
(uint32_t) HeightMMOfScreen(screen)
|
||||
(uint32_t) HeightMMOfScreen(screen),
|
||||
"xlib"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -193,7 +194,8 @@ static bool xrandrHandleCrtc(XrandrData* data, XRROutputInfo* output, FFstrbuf*
|
||||
primary,
|
||||
0,
|
||||
(uint32_t) output->mm_width,
|
||||
(uint32_t) output->mm_height
|
||||
(uint32_t) output->mm_height,
|
||||
"xlib-randr-crtc"
|
||||
);
|
||||
|
||||
if (edidLength)
|
||||
@@ -268,7 +270,8 @@ static bool xrandrHandleMonitor(XrandrData* data, XRRMonitorInfo* monitorInfo)
|
||||
!!monitorInfo->primary,
|
||||
0,
|
||||
(uint32_t) monitorInfo->mwidth,
|
||||
(uint32_t) monitorInfo->mheight
|
||||
(uint32_t) monitorInfo->mheight,
|
||||
"xlib-randr-monitor"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -318,7 +321,8 @@ static void xrandrHandleScreen(XrandrData* data, Screen* screen)
|
||||
false,
|
||||
0,
|
||||
(uint32_t) WidthMMOfScreen(screen),
|
||||
(uint32_t) HeightMMOfScreen(screen)
|
||||
(uint32_t) HeightMMOfScreen(screen),
|
||||
"xlib_randr_screen"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
#define FF_DISPLAY_NUM_FORMAT_ARGS 18
|
||||
#define FF_DISPLAY_NUM_FORMAT_ARGS 19
|
||||
|
||||
static int sortByNameAsc(FFDisplayResult* a, FFDisplayResult* b)
|
||||
{
|
||||
@@ -181,6 +181,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
|
||||
FF_FORMAT_ARG(result->manufactureYear, "manufacture-year"),
|
||||
FF_FORMAT_ARG(result->manufactureWeek, "manufacture-week"),
|
||||
FF_FORMAT_ARG(buf, "serial"),
|
||||
FF_FORMAT_ARG(result->platformApi, "platform-api"),
|
||||
}));
|
||||
}
|
||||
}
|
||||
@@ -395,6 +396,8 @@ void ffGenerateDisplayJsonResult(FF_MAYBE_UNUSED FFDisplayOptions* options, yyjs
|
||||
yyjson_mut_obj_add_uint(doc, obj, "serial", item->serial);
|
||||
else
|
||||
yyjson_mut_obj_add_null(doc, obj, "serial");
|
||||
|
||||
yyjson_mut_obj_add_str(doc, obj, "platformApi", item->platformApi);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -419,6 +422,7 @@ void ffPrintDisplayHelpFormat(void)
|
||||
"Year of manufacturing - manufacture-year",
|
||||
"Nth week of manufacturing in the year - manufacture-week",
|
||||
"Serial number - serial",
|
||||
"The platform API used when detecting the display - platform-api",
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user