Closed Jomy10 closed 10 months ago
Hi @Jomy10 I had a look at it and there is a bug in there. Currently the display has to announce it has a default resolution if it does not then "-r" option just shows the last resolution it found while the the filling will abort. For you maybe the following patch would work:
diff --git a/framebuffer.c b/framebuffer.c
index 260ebfa..389f611 100644
--- a/framebuffer.c
+++ b/framebuffer.c
@@ -116,10 +116,9 @@ int get_framebuffer(const char *dri_device, const char *connector_name, struct f
/* Get the preferred resolution */
drmModeModeInfoPtr resolution = 0;
for (int i = 0; i < connector->count_modes; i++) {
- drmModeModeInfoPtr res = 0;
- res = &connector->modes[i];
- if (res->type & DRM_MODE_TYPE_PREFERRED)
- resolution = res;
+ resolution = &connector->modes[i];
+ if (resolution->type & DRM_MODE_TYPE_PREFERRED)
+ break;
}
if (!resolution) {
But I think I need to cleanup that stuff and make it possible to select a specific resolution
Commit https://github.com/embear-engineering/drm-framebuffer/commit/77fc4b5571e04160b348843bcedf8939c1e6d529 should solve this issue by using the first possible resolution when no resolution is specified.
when I use -r: