drm: Blacklist 4096x2160 mode
This mode is required for certaiin certifications but is effectively useless and doesn't fit the actual screen size of displays. (Gets scaled down)
This commit is contained in:
parent
608de1c19e
commit
c49cac3a00
1 changed files with 23 additions and 0 deletions
23
src/drm.cpp
23
src/drm.cpp
|
@ -562,11 +562,34 @@ static bool get_resources(struct drm_t *drm)
|
|||
return true;
|
||||
}
|
||||
|
||||
struct mode_blocklist_entry
|
||||
{
|
||||
uint32_t width, height, refresh;
|
||||
};
|
||||
|
||||
// Filter out reporting some modes that are required for
|
||||
// certain certifications, but are completely useless,
|
||||
// and probably don't fit the display pixel size.
|
||||
static mode_blocklist_entry g_badModes[] =
|
||||
{
|
||||
{ 4096, 2160, 0 },
|
||||
};
|
||||
|
||||
static const drmModeModeInfo *find_mode( const drmModeConnector *connector, int hdisplay, int vdisplay, uint32_t vrefresh )
|
||||
{
|
||||
for (int i = 0; i < connector->count_modes; i++) {
|
||||
const drmModeModeInfo *mode = &connector->modes[i];
|
||||
|
||||
bool bad = false;
|
||||
for (const auto& badMode : g_badModes) {
|
||||
bad |= (badMode.width == 0 || mode->hdisplay == badMode.width)
|
||||
&& (badMode.height == 0 || mode->vdisplay == badMode.height)
|
||||
&& (badMode.refresh == 0 || mode->vrefresh == badMode.refresh);
|
||||
}
|
||||
|
||||
if (bad)
|
||||
continue;
|
||||
|
||||
if (hdisplay != 0 && hdisplay != mode->hdisplay)
|
||||
continue;
|
||||
if (vdisplay != 0 && vdisplay != mode->vdisplay)
|
||||
|
|
Loading…
Reference in a new issue