[gnome-settings-daemon] color: Remove EDID parsing code
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] color: Remove EDID parsing code
- Date: Thu, 1 Sep 2022 20:33:01 +0000 (UTC)
commit 4f02998906d543b9aa5f3b22974e7e394c75a922
Author: Jonas Ã…dahl <jadahl gmail com>
Date: Tue Dec 7 09:26:09 2021 +0100
color: Remove EDID parsing code
EDID parsing is done in mutter, no need to keep a copy here.
plugins/color/gcm-edid.c | 450 ------------------------------------------
plugins/color/gcm-edid.h | 63 ------
plugins/color/gcm-self-test.c | 71 -------
plugins/color/meson.build | 2 -
4 files changed, 586 deletions(-)
---
diff --git a/plugins/color/gcm-self-test.c b/plugins/color/gcm-self-test.c
index 7ff01f68..e2938614 100644
--- a/plugins/color/gcm-self-test.c
+++ b/plugins/color/gcm-self-test.c
@@ -25,7 +25,6 @@
#include <glib-object.h>
#include <stdlib.h>
-#include "gcm-edid.h"
#include "gsd-color-state.h"
#include "gsd-night-light.h"
#include "gsd-night-light-common.h"
@@ -273,75 +272,6 @@ gcm_test_night_light (void)
g_assert_cmpint (gsd_night_light_get_temperature (nlight), >=, (GSD_COLOR_TEMPERATURE_DEFAULT +
4000) / 2 - 20);
}
-static const gboolean
-gcm_vendor_is_goldstar (const char * const vendor) {
- if (g_strcmp0 (vendor, "Goldstar Company Ltd") == 0)
- return TRUE;
- /* Goldstar was changed to LG in hwdb (systemd) 240.
- * https://github.com/systemd/systemd/commit/c6d7a5e9a3836f8
- */
- if (g_strcmp0 (vendor, "LG Electronics") == 0)
- return TRUE;
- return FALSE;
-}
-
-static void
-gcm_test_edid_func (void)
-{
- GcmEdid *edid;
- gchar *data;
- gboolean ret;
- GError *error = NULL;
- gsize length = 0;
-
- edid = gcm_edid_new ();
- g_assert (edid != NULL);
-
- /* LG 21" LCD panel */
- ret = g_file_get_contents (TESTDATADIR "/LG-L225W-External.bin",
- &data, &length, &error);
- g_assert_no_error (error);
- g_assert (ret);
- ret = gcm_edid_parse (edid, (const guint8 *) data, length, &error);
- g_assert_no_error (error);
- g_assert (ret);
-
- g_assert_cmpstr (gcm_edid_get_monitor_name (edid), ==, "L225W");
- g_assert_true (gcm_vendor_is_goldstar (gcm_edid_get_vendor_name (edid)));
- g_assert_cmpstr (gcm_edid_get_serial_number (edid), ==, "34398");
- g_assert_cmpstr (gcm_edid_get_eisa_id (edid), ==, NULL);
- g_assert_cmpstr (gcm_edid_get_checksum (edid), ==, "0bb44865bb29984a4bae620656c31368");
- g_assert_cmpstr (gcm_edid_get_pnp_id (edid), ==, "GSM");
- g_assert_cmpint (gcm_edid_get_height (edid), ==, 30);
- g_assert_cmpint (gcm_edid_get_width (edid), ==, 47);
- g_assert_cmpfloat (gcm_edid_get_gamma (edid), >=, 2.2f - 0.01);
- g_assert_cmpfloat (gcm_edid_get_gamma (edid), <, 2.2f + 0.01);
- g_free (data);
-
- /* Lenovo T61 internal Panel */
- ret = g_file_get_contents (TESTDATADIR "/Lenovo-T61-Internal.bin",
- &data, &length, &error);
- g_assert_no_error (error);
- g_assert (ret);
- ret = gcm_edid_parse (edid, (const guint8 *) data, length, &error);
- g_assert_no_error (error);
- g_assert (ret);
-
- g_assert_cmpstr (gcm_edid_get_monitor_name (edid), ==, NULL);
- g_assert_cmpstr (gcm_edid_get_vendor_name (edid), ==, "IBM Brasil");
- g_assert_cmpstr (gcm_edid_get_serial_number (edid), ==, NULL);
- g_assert_cmpstr (gcm_edid_get_eisa_id (edid), ==, "LTN154P2-L05");
- g_assert_cmpstr (gcm_edid_get_checksum (edid), ==, "e1865128c7cd5e5ed49ecfc8102f6f9c");
- g_assert_cmpstr (gcm_edid_get_pnp_id (edid), ==, "IBM");
- g_assert_cmpint (gcm_edid_get_height (edid), ==, 21);
- g_assert_cmpint (gcm_edid_get_width (edid), ==, 33);
- g_assert_cmpfloat (gcm_edid_get_gamma (edid), >=, 2.2f - 0.01);
- g_assert_cmpfloat (gcm_edid_get_gamma (edid), <, 2.2f + 0.01);
- g_free (data);
-
- g_object_unref (edid);
-}
-
static void
gcm_test_sunset_sunrise (void)
{
@@ -419,7 +349,6 @@ main (int argc, char **argv)
mainloop = g_main_loop_new (g_main_context_default (), FALSE);
- g_test_add_func ("/color/edid", gcm_test_edid_func);
g_test_add_func ("/color/sunset-sunrise", gcm_test_sunset_sunrise);
g_test_add_func ("/color/sunset-sunrise/fractional-timezone",
gcm_test_sunset_sunrise_fractional_timezone);
g_test_add_func ("/color/fractional-day", gcm_test_frac_day);
diff --git a/plugins/color/meson.build b/plugins/color/meson.build
index effe1f64..7bcd1f13 100644
--- a/plugins/color/meson.build
+++ b/plugins/color/meson.build
@@ -1,5 +1,4 @@
sources = files(
- 'gcm-edid.c',
'gnome-datetime-source.c',
'gsd-color-calibrate.c',
'gsd-color-manager.c',
@@ -33,7 +32,6 @@ executable(
)
sources = files(
- 'gcm-edid.c',
'gcm-self-test.c',
'gnome-datetime-source.c',
'gsd-night-light.c',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]