[mutter] Revert "gpu-kms: Handle drmModeGetResources() failing"
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] Revert "gpu-kms: Handle drmModeGetResources() failing"
- Date: Fri, 10 Aug 2018 16:32:49 +0000 (UTC)
commit 37eeda0320eb9fa49c521f26b4f5896d85cd9152
Author: Jonas Ådahl <jadahl gmail com>
Date: Fri Aug 10 16:31:03 2018 +0000
Revert "gpu-kms: Handle drmModeGetResources() failing"
This reverts commit acf70a35611bfd6c3c4f46279f80fea52873193e
src/backends/native/meta-gpu-kms.c | 36 +++++-------------------------------
1 file changed, 5 insertions(+), 31 deletions(-)
---
diff --git a/src/backends/native/meta-gpu-kms.c b/src/backends/native/meta-gpu-kms.c
index 36e08857a..4be5d8550 100644
--- a/src/backends/native/meta-gpu-kms.c
+++ b/src/backends/native/meta-gpu-kms.c
@@ -68,8 +68,6 @@ struct _MetaGpuKms
int max_buffer_height;
gboolean page_flips_not_supported;
-
- gboolean resources_init_failed_before;
};
G_DEFINE_TYPE (MetaGpuKms, meta_gpu_kms, META_TYPE_GPU)
@@ -728,34 +726,20 @@ init_outputs (MetaGpuKms *gpu_kms,
setup_output_clones (gpu);
}
-static gboolean
-meta_kms_resources_init (MetaKmsResources *resources,
- int fd,
- GError **error)
-
+static void
+meta_kms_resources_init (MetaKmsResources *resources,
+ int fd)
{
drmModeRes *drm_resources;
unsigned int i;
drm_resources = drmModeGetResources (fd);
-
- if (!drm_resources)
- {
- g_set_error (error,
- G_IO_ERROR,
- G_IO_ERROR_FAILED,
- "Calling drmModeGetResources() failed");
- return FALSE;
- }
-
resources->resources = drm_resources;
resources->n_encoders = (unsigned int) drm_resources->count_encoders;
resources->encoders = g_new (drmModeEncoder *, resources->n_encoders);
for (i = 0; i < resources->n_encoders; i++)
resources->encoders[i] = drmModeGetEncoder (fd, drm_resources->encoders[i]);
-
- return TRUE;
}
static void
@@ -767,7 +751,7 @@ meta_kms_resources_release (MetaKmsResources *resources)
drmModeFreeEncoder (resources->encoders[i]);
g_free (resources->encoders);
- g_clear_pointer (&resources->resources, drmModeFreeResources);
+ drmModeFreeResources (resources->resources);
}
static gboolean
@@ -778,18 +762,8 @@ meta_gpu_kms_read_current (MetaGpu *gpu,
MetaMonitorManager *monitor_manager =
meta_gpu_get_monitor_manager (gpu);
MetaKmsResources resources;
- g_autoptr (GError) local_error = NULL;
- if (!meta_kms_resources_init (&resources, gpu_kms->fd, &local_error))
- {
- if (!gpu_kms->resources_init_failed_before)
- {
- g_warning ("meta_kms_resources_init failed: %s, assuming we have no outputs",
- local_error->message);
- gpu_kms->resources_init_failed_before = TRUE;
- return TRUE;
- }
- }
+ meta_kms_resources_init (&resources, gpu_kms->fd);
gpu_kms->max_buffer_width = resources.resources->max_width;
gpu_kms->max_buffer_height = resources.resources->max_height;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]