Skip to contentSkip to conversation

apple-gmux: Add initial documentation

PATCH In review Lukas Wunner 3 participants 8 messages Jan 10, 2016 – Jan 11, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v2 cover apple-gmux: Add initial documentation

Quoted 3 lines · Jonathan Corbet

Well, it's built around the asciidoc patch, which isn't in the mainline at this point. Should things go a different direction, that could force some changes here;

If/when that happens, I'll be happy to fixup the documentation as needed. In fact I originally wrote this in markdown in November, then converted it to asciidoc in December and that really wasn't a big deal.

The need for asciidoc arises from the desire to not clutter up the prose text with URLs. To achieve this, asciidoc allows defining so-called "attribute entries" which may then be referenced in the text:
http://asciidoc.org/userguide.html#X62

Markdown has a similar feature called "reference style links", the difference being that they can be defined anywhere in the document, whereas asciidoc's "attribute entries" must precede their usage in the text:
https://daringfireball.net/projects/markdown/syntax#link

Here's a v2, the only change is Bruno Pr�mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

An ack for drivers/platform/x86 was kindly provided by Darren Hart with:
Message-ID: <[email protected]>

Thanks everyone!

Lukas Wunner (1):
apple-gmux: Add initial documentation

 Documentation/DocBook/gpu.tmpl    |  22 ++++++++
 drivers/platform/x86/apple-gmux.c | 113 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
Signature · 1 line
1.8.5.2 (Apple Git-48)
#1 lore raw

PATCH v2 1/1 apple-gmux: Add initial documentation

Document what I've learned so far about the gmux so that we can collaboratively reverse-engineer its remaining unknown bits without everyone having to start from scratch.

The DOC sections are bound together in the gpu.tmpl DocBook under a new vga_switcheroo "Handlers" chapter. Eventually this should be amended with documentation about the four other handlers that exist so far (nouveau v1 DSM, nouveau Optimus DSM, radeon ATPX, amdgpu ATPX).

Requires kernel-doc with asciidoc support.

The EFI variable was reverse-engineered by Bruno Bierbaumer <[email protected]> and Andreas Heider <[email protected]>.

Some of the remaining open questions:

* How are vblank intervals synchronized on retinas to achieve seamless switching? Is the DP mux capable of this? It's not mentioned in the data sheets. Or is it done at the OS level, i.e. do we have to synchronize vblank intervals between DRM drivers? There's a signal coming from the panel connector and going into gmux, could this be the vblank signal as received by the panel to properly time the switch?

* On retinas there's an I2C bus between gmux and the connector of the right I/O board, apparently leading to the Parade PS8401A HDMI repeater. What is this for, is it controlled via gmux registers? Data sheet:
http://www.paradetech.com/products/jitter-cleaning-repeaters/ps8401/

* On retinas there's an I2C bus between gmux and the LED driver. Pre-retinas connected the LED driver to SMBUS. Are there additional gmux registers on retinas to control it?

* The MacPro6,1 2013 also has a gmux, the same Renesas R4F2113 as the retina MacBook Pro. The Mac Pro doesn't have a built-in display, so what is its purpose? Power control of the dual FirePro GPUs? Switching of the external DP/Thunderbolt ports? The iFixit teardown clearly shows one TI HD3SS212 DisplayPort mux on the logic board next to one of the three Thunderbolt controllers. However six muxes would be necessary to switch all six ports between GPUs. The mux is probably necessary for one of the display configurations allowed by Apple, but which one?
https://www.ifixit.com/Teardown/Mac+Pro+Late+2013+Teardown/20778
https://d3nevzfk7ii3be.cloudfront.net/igi/fELBTnt31QhnDsqq.huge
https://support.apple.com/en-us/HT202801

* Registers we haven't decoded yet:
0x700 32 Bit configmap?
0x708 32 Bit power sequence?
0x712 8 Bit status of clock from panel on retinas? 0x713 8 Bit dito?
0x724 16 Bit backlight, raw value?
0x760 32 Bit backlight
0x764 32 Bit backlight
0x768 8 Bit backlight
0x76a 16 Bit backlight
0x76c 16 Bit backlight
0x76e 16 Bit backlight
0x77f edp/dp/hdmi probe? retina only.

* Addition by Bruno Prémont <[email protected]>:
"Missing is also precise knowledge as to what the gmux depends on. From behavioral reports, it is somehow sensitive to VGA IO/MEM routing (it apparently needs the routing to go to integrated GPU, not discrete GPU).
When the routing is inappropriate backlight control IO just reads back as 0xFF (and eventually gmux IO in general does so)."

---
 Documentation/DocBook/gpu.tmpl    |  22 ++++++++
 drivers/platform/x86/apple-gmux.c | 113 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
Documentation/DocBook/gpu.tmpl +22 -0
index faa5e0d..a866933 100644
@@ -3470,8 +3470,30 @@ int num_ioctls;</synopsis>
     </sect1>
   </chapter>
 
+  <chapter id="handlers">
+    <title>Handlers</title>
+    <sect1>
+      <title>apple-gmux Handler</title>
+!Pdrivers/platform/x86/apple-gmux.c Overview
+!Pdrivers/platform/x86/apple-gmux.c Interrupt
+      <sect2>
+        <title>Graphics mux</title>
+!Pdrivers/platform/x86/apple-gmux.c Graphics mux
+      </sect2>
+      <sect2>
+        <title>Power control</title>
+!Pdrivers/platform/x86/apple-gmux.c Power control
+      </sect2>
+      <sect2>
+        <title>Backlight control</title>
+!Pdrivers/platform/x86/apple-gmux.c Backlight control
+      </sect2>
+    </sect1>
+  </chapter>
+
 !Cdrivers/gpu/vga/vga_switcheroo.c
 !Cinclude/linux/vga_switcheroo.h
+!Cdrivers/platform/x86/apple-gmux.c
 </part>
 
 </book>
drivers/platform/x86/apple-gmux.c +113 -0

149 lines not on this page · raw message

Signature · 1 line
1.8.5.2 (Apple Git-48)
#2 lore raw
In reply to Lukas Wunner
Quoted 21 lines · Lukas Wunner
Quoted 3 lines · Jonathan Corbet

Well, it's built around the asciidoc patch, which isn't in the mainline at this point. Should things go a different direction, that could force some changes here;

If/when that happens, I'll be happy to fixup the documentation as needed. In fact I originally wrote this in markdown in November, then converted it to asciidoc in December and that really wasn't a big deal.

The need for asciidoc arises from the desire to not clutter up the prose text with URLs. To achieve this, asciidoc allows defining so-called "attribute entries" which may then be referenced in the text:
http://asciidoc.org/userguide.html#X62

Markdown has a similar feature called "reference style links", the difference being that they can be defined anywhere in the document, whereas asciidoc's "attribute entries" must precede their usage in the text:
https://daringfireball.net/projects/markdown/syntax#link

Quoted 4 lines

Here's a v2, the only change is Bruno Pr?mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

I think it makes more sense to pull this in through Darren's tree, and I acked that on the last round already.
-Daniel

Quoted 18 lines

An ack for drivers/platform/x86 was kindly provided by Darren Hart with:
Message-ID: <[email protected]>

Thanks everyone!

Lukas Wunner (1):
apple-gmux: Add initial documentation

 Documentation/DocBook/gpu.tmpl    |  22 ++++++++
 drivers/platform/x86/apple-gmux.c | 113 ++++++++++++++++++++++++++++++++++++++
 2 files changed, 135 insertions(+)
Signature · 1 line
1.8.5.2 (Apple Git-48)
Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#3 lore raw

Hi Daniel,

Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Lukas Wunner

Here's a v2, the only change is Bruno Pr?mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

I think it makes more sense to pull this in through Darren's tree, and I acked that on the last round already.

As I've written in the cover letter of v1, this will provoke merge conflicts going forward since I'll post a new version of my GPU switching patches for the MacBook Pro this week which also touch apple-gmux and are based on this docs patch.

I guess alternatively the patches touching vga_switcheroo and the DRM drivers could go in via pdx86, I'll cross-post to both lists to keep this option open, though I expect this might also lead to merge conflicts if relevant portions of the DRM drivers are changed in drm-next for 4.6.

I still believe merging this via drm-next or drm-intel/topic/drm-misc would be the option least prone to merge conflicts.

Thanks,

Lukas

#4 lore raw
Quoted 17 lines · Lukas Wunner

Hi Daniel,

Quoted 8 lines · Daniel Vetter
Quoted 4 lines · Lukas Wunner

Here's a v2, the only change is Bruno Pr?mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

I think it makes more sense to pull this in through Darren's tree, and I acked that on the last round already.

As I've written in the cover letter of v1, this will provoke merge conflicts going forward since I'll post a new version of my GPU switching patches for the MacBook Pro this week which also touch apple-gmux and are based on this docs patch.

Quoted 7 lines

I guess alternatively the patches touching vga_switcheroo and the DRM drivers could go in via pdx86, I'll cross-post to both lists to keep this option open, though I expect this might also lead to merge conflicts if relevant portions of the DRM drivers are changed in drm-next for 4.6.

I still believe merging this via drm-next or drm-intel/topic/drm-misc would be the option least prone to merge conflicts.

Ah sorry, forgot about that again. Indeed that makes sense if other stuff is pending, so applied to drm-misc for 4.6.

Cheers, Daniel

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
#5 lore raw
In reply to Daniel Vetter
Quoted 22 lines · Daniel Vetter
Quoted 21 lines · Lukas Wunner
Quoted 3 lines · Jonathan Corbet

Well, it's built around the asciidoc patch, which isn't in the mainline at this point. Should things go a different direction, that could force some changes here;

If/when that happens, I'll be happy to fixup the documentation as needed. In fact I originally wrote this in markdown in November, then converted it to asciidoc in December and that really wasn't a big deal.

The need for asciidoc arises from the desire to not clutter up the prose text with URLs. To achieve this, asciidoc allows defining so-called "attribute entries" which may then be referenced in the text:
http://asciidoc.org/userguide.html#X62

Markdown has a similar feature called "reference style links", the difference being that they can be defined anywhere in the document, whereas asciidoc's "attribute entries" must precede their usage in the text:
https://daringfireball.net/projects/markdown/syntax#link

Quoted 7 lines
Quoted 4 lines

Here's a v2, the only change is Bruno Pr?mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

I think it makes more sense to pull this in through Darren's tree, and I acked that on the last round already.

OK, I'm happy to take it. Lukas, this doesn't apply cleanly to my 4.4-rc* based for-next branch or Linus's 4.4 from yesterday. I can manually apply it:

$ patch -p1 < ~/incoming/PATCH_v2_1-1_apple-gmux_Add_initial_documentation.mbox 
patching file Documentation/DocBook/gpu.tmpl
Hunk #1 succeeded at 4279 with fuzz 1 (offset 809 lines).
patching file drivers/platform/x86/apple-gmux.c

But that is one hell of an offset. What are you developing against and can you send me something that applies cleanly?

Signature · 2 lines
Darren Hart
Intel Open Source Technology Center
#6 lore raw

Hi Darren,

Quoted 34 lines · Darren Hart
Quoted 22 lines · Daniel Vetter
Quoted 21 lines · Lukas Wunner
Quoted 3 lines · Jonathan Corbet

Well, it's built around the asciidoc patch, which isn't in the mainline at this point. Should things go a different direction, that could force some changes here;

If/when that happens, I'll be happy to fixup the documentation as needed. In fact I originally wrote this in markdown in November, then converted it to asciidoc in December and that really wasn't a big deal.

The need for asciidoc arises from the desire to not clutter up the prose text with URLs. To achieve this, asciidoc allows defining so-called "attribute entries" which may then be referenced in the text:
http://asciidoc.org/userguide.html#X62

Markdown has a similar feature called "reference style links", the difference being that they can be defined anywhere in the document, whereas asciidoc's "attribute entries" must precede their usage in the text:
https://daringfireball.net/projects/markdown/syntax#link

Quoted 7 lines
Quoted 4 lines

Here's a v2, the only change is Bruno Pr?mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

I think it makes more sense to pull this in through Darren's tree, and I acked that on the last round already.

OK, I'm happy to take it. Lukas, this doesn't apply cleanly to my 4.4-rc* based for-next branch or Linus's 4.4 from yesterday. I can manually apply it:

Quoted 7 lines
$ patch -p1 < ~/incoming/PATCH_v2_1-1_apple-gmux_Add_initial_documentation.mbox 
patching file Documentation/DocBook/gpu.tmpl
Hunk #1 succeeded at 4279 with fuzz 1 (offset 809 lines).
patching file drivers/platform/x86/apple-gmux.c

But that is one hell of an offset. What are you developing against and can you send me something that applies cleanly?

I'm developing against drm-next and/or drm-intel-nightly. Looks like gpu.tmpl is touched very frequently. :-)

As for the apple-gmux documentation, Daniel picked it up this afternoon:
http://cgit.freedesktop.org/drm-intel/commit/?h=topic/drm-misc&id=3d7b75fdae9c81dd71c7573dbc285af90e0924fa

So, everything's fine. Thanks a lot though for being such a responsive and speedy maintainer, much appreciated!

Best regards,

Lukas

#7 lore raw
Quoted 45 lines · Lukas Wunner

Hi Darren,

Quoted 34 lines · Darren Hart
Quoted 22 lines · Daniel Vetter
Quoted 21 lines · Lukas Wunner
Quoted 3 lines · Jonathan Corbet

Well, it's built around the asciidoc patch, which isn't in the mainline at this point. Should things go a different direction, that could force some changes here;

If/when that happens, I'll be happy to fixup the documentation as needed. In fact I originally wrote this in markdown in November, then converted it to asciidoc in December and that really wasn't a big deal.

The need for asciidoc arises from the desire to not clutter up the prose text with URLs. To achieve this, asciidoc allows defining so-called "attribute entries" which may then be referenced in the text:
http://asciidoc.org/userguide.html#X62

Markdown has a similar feature called "reference style links", the difference being that they can be defined anywhere in the document, whereas asciidoc's "attribute entries" must precede their usage in the text:
https://daringfireball.net/projects/markdown/syntax#link

Quoted 7 lines
Quoted 4 lines

Here's a v2, the only change is Bruno Pr?mont's addition to the commit message.

@Daniel Vetter: Could you pick this up for topic/drm-misc please?

I think it makes more sense to pull this in through Darren's tree, and I acked that on the last round already.

OK, I'm happy to take it. Lukas, this doesn't apply cleanly to my 4.4-rc* based for-next branch or Linus's 4.4 from yesterday. I can manually apply it:

Quoted 7 lines
$ patch -p1 < ~/incoming/PATCH_v2_1-1_apple-gmux_Add_initial_documentation.mbox 
patching file Documentation/DocBook/gpu.tmpl
Hunk #1 succeeded at 4279 with fuzz 1 (offset 809 lines).
patching file drivers/platform/x86/apple-gmux.c

But that is one hell of an offset. What are you developing against and can you send me something that applies cleanly?

Quoted 9 lines

I'm developing against drm-next and/or drm-intel-nightly. Looks like gpu.tmpl is touched very frequently. :-)

As for the apple-gmux documentation, Daniel picked it up this afternoon:
http://cgit.freedesktop.org/drm-intel/commit/?h=topic/drm-misc&id=3d7b75fdae9c81dd71c7573dbc285af90e0924fa

So, everything's fine. Thanks a lot though for being such a responsive and speedy maintainer, much appreciated!

Hah, and here I am beating myself up over letting things stagnate. Thanks :-)

Signature · 6 lines
Darren Hart
Intel Open Source Technology Center
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel