After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 676006 - If EDID mapping fails, try to find a built-in output
If EDID mapping fails, try to find a built-in output
Status: RESOLVED FIXED
Product: gnome-control-center
Classification: Core
Component: Wacom
unspecified
Other Linux
: Normal normal
: ---
Assigned To: Peter Hutterer
Control-Center Maintainers
Depends on: 677032
Blocks:
 
 
Reported: 2012-05-14 03:35 UTC by Peter Hutterer
Modified: 2012-06-19 15:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
0001-wacom-add-helper-function-to-get-output-list.patch (2.37 KB, patch)
2012-05-14 03:35 UTC, Peter Hutterer
needs-work Details | Review
0002-wacom-if-edid-matching-fails-search-for-eDP-LVDS-bui.patch (1.75 KB, patch)
2012-05-14 03:36 UTC, Peter Hutterer
needs-work Details | Review
0001-wacom-add-helper-function-to-get-output-list.patch (5.33 KB, patch)
2012-05-28 07:24 UTC, Peter Hutterer
reviewed Details | Review
0001-wacom-if-edid-matching-fails-search-for-eDP-LVDS-bui.patch (1.60 KB, patch)
2012-05-28 07:25 UTC, Peter Hutterer
needs-work Details | Review
Updated and consolidated patch (4.29 KB, patch)
2012-06-19 09:52 UTC, Olivier Fourdan
reviewed Details | Review

Description Peter Hutterer 2012-05-14 03:35:16 UTC
Created attachment 213979 [details] [review]
0001-wacom-add-helper-function-to-get-output-list.patch

serial devices with no useful EDID cannot be calibrated, we just see the error message below:

(gnome-control-center:11071): wacom-cc-panel-WARNING **: No fuzzy match based
on heuristics was found.

(gnome-control-center:11071): wacom-cc-panel-CRITICAL **: Output associated
with the tablet is not connected. Unable to calibrate.


Attached patches add output name matching. If no edid mapping was found, search for eDP or LVDS outputs, they're built-in. The first patch is just a cleanup to re-use some code.
Comment 1 Peter Hutterer 2012-05-14 03:36:51 UTC
Created attachment 213980 [details] [review]
0002-wacom-if-edid-matching-fails-search-for-eDP-LVDS-bui.patch
Comment 2 Bastien Nocera 2012-05-18 09:56:25 UTC
Review of attachment 213979 [details] [review]:

I would put those 3 items into their own structure, and have its own free/destroy function. This would also make keeping the data around for 2 consecutive calls easier.
Comment 3 Bastien Nocera 2012-05-18 09:57:38 UTC
Review of attachment 213980 [details] [review]:

As mentioned in the other patch's review, you're poking the hardware once already, then destroying everything, and building it again. Keep the screen data around for long enough to do what you need to do.
Comment 4 Peter Hutterer 2012-05-28 07:24:59 UTC
Created attachment 215111 [details] [review]
0001-wacom-add-helper-function-to-get-output-list.patch

Updated. Changes to v1: get output list once in find_output, then re-use across find_output_*
Comment 5 Peter Hutterer 2012-05-28 07:25:31 UTC
Created attachment 215112 [details] [review]
0001-wacom-if-edid-matching-fails-search-for-eDP-LVDS-bui.patch

Updated. Changes to v1: use pre-filled output list
Comment 6 Bastien Nocera 2012-05-28 12:10:53 UTC
Review of attachment 215112 [details] [review]:

::: panels/wacom/gsd-wacom-device.c
@@ +591,3 @@
+		name = gnome_rr_output_info_get_name (*rr_output_info);
+		if (g_str_has_prefix (name, "eDP") ||
+		    g_str_has_prefix (name, "LVDS"))

The misnamed "gnome_rr_output_is_laptop()" function does that, and it even handles connector types from RANDR 1.3
Comment 7 Bastien Nocera 2012-05-28 12:13:03 UTC
Review of attachment 215111 [details] [review]:

::: panels/wacom/gsd-wacom-device.c
@@ +495,3 @@
 
+static void
+gsd_wacom_output_list_finalize (GsdWacomRROutputList *ol)

finalize() is for objects. Use _free()

@@ +498,3 @@
+{
+	if (ol->rr_screen)
+		g_object_unref (ol->rr_screen);

g_clear_object()

@@ +500,3 @@
+		g_object_unref (ol->rr_screen);
+	if (ol->rr_screen)
+		g_object_unref (ol->rr_config);

Ditto.
Comment 8 Peter Hutterer 2012-05-29 01:20:03 UTC
(In reply to comment #6)
> Review of attachment 215112 [details] [review]:
> 
> ::: panels/wacom/gsd-wacom-device.c
> @@ +591,3 @@
> +        name = gnome_rr_output_info_get_name (*rr_output_info);
> +        if (g_str_has_prefix (name, "eDP") ||
> +            g_str_has_prefix (name, "LVDS"))
> 
> The misnamed "gnome_rr_output_is_laptop()" function does that, and it even
> handles connector types from RANDR 1.3

how do I convert from GnomeRROutputInfo to GnomeRROutput?
Comment 9 Bastien Nocera 2012-05-29 09:56:08 UTC
(In reply to comment #8)
> (In reply to comment #6)
> > Review of attachment 215112 [details] [review] [details]:
> > 
> > ::: panels/wacom/gsd-wacom-device.c
> > @@ +591,3 @@
> > +        name = gnome_rr_output_info_get_name (*rr_output_info);
> > +        if (g_str_has_prefix (name, "eDP") ||
> > +            g_str_has_prefix (name, "LVDS"))
> > 
> > The misnamed "gnome_rr_output_is_laptop()" function does that, and it even
> > handles connector types from RANDR 1.3
> 
> how do I convert from GnomeRROutputInfo to GnomeRROutput?

Sigh, yes. The whole code in GsdWacomDevice uses GnomeRROutputInfo, which is a flattened version of the current XRandR configuration, usually for storage into config files.

We shouldn't be using GnomeRROutputInfo at all...
Comment 10 Bastien Nocera 2012-05-29 14:22:18 UTC
We can now use GnomeRROutput after bug 677032 gets merged. This makes the laptop detection much better too, as we can rely on the connector type.

Sorry about the churn.
Comment 11 Olivier Fourdan 2012-06-19 09:52:58 UTC
Created attachment 216726 [details] [review]
Updated and consolidated patch

Now that the patch for bug 677032 got merged, we really do not need to create a new structure, passing "GnomeRRScreen *" is enough.

This new patch removes the now unnecessary GsdWacomRROutputList structure added by the previous versions of the same and uses GnomeRRScreen to avoid querying the hardware multiple times.

It also uses gnome_rr_output_is_laptop() to identify the built-in monitor.
Comment 12 Olivier Fourdan 2012-06-19 09:54:37 UTC
_Note_: all this really belongs to gnome-settings-daemon and not gnome-control-center, so the proposed patch (attachment 216726 [details] [review]) is meant to be applied to gnome-settings-daemon.
Comment 13 Bastien Nocera 2012-06-19 13:59:18 UTC
Review of attachment 216726 [details] [review]:

Looks fine otherwise.

::: plugins/wacom/gsd-wacom-device.c
@@ +754,3 @@
+	}
+
+	rr_output = find_output_by_display (rr_screen, device);

Are you leaking rr_output if it's not a screen tablet?
Comment 14 Olivier Fourdan 2012-06-19 14:27:04 UTC
(In reply to comment #13)
> Are you leaking rr_output if it's not a screen tablet?

No leak there, it's the returned value.

That value is unref'ed later by the caller (gsd_wacom_device_get_display_monitor())
Comment 15 Olivier Fourdan 2012-06-19 15:47:36 UTC
Committed in gnome-settings-daemon and pulled in gnome-control-center