Announcement

Collapse
No announcement yet.

Zaphod mode with the Open Source Driver?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • #11
    Originally posted by agd5f View Post
    zaphod doesn't work like xrandr. You can't pick arbitrary outputs. The driver just grabs the first two outputs and assigns one to each instance of the driver. If you have more than two outputs the remaining outputs are unavailable with zaphod.
    Here's a shortened version of my xorg.conf...

    Code:
    Section "ServerLayout"
    	Screen	0	"Screen0" 0 0
    	Screen		"Screen1" LeftOf "Screen0"
    EndSection
    
    Section "Monitor"
            Identifier "DIN"
    EndSection
    
    Section "Monitor"
    	Identifier   "DVI-0"
    EndSection
    
    Section "Monitor"
    	Identifier   "DVI-1"
    EndSection
    
    Section "Device"
    	Identifier  "Card0"
    	Screen 0
    EndSection
    
    Section "Device"
    	Identifier  "Card1"
    	Screen 1
    EndSection
    
    Section "Screen"
    	Identifier "Screen0"
    	Device "Card0"
    	Monitor "DVI-0"
    EndSection
    
    Section "Screen"
    	Identifier "Screen1"
    	Device "Card1"
    	Monitor "DVI-1"
    EndSection
    Now given that it correctly matches the monitor sections with the actual outputs when put in this order, isn't there enough information here to determine which outputs I want to use? The screen sections each bind a monitor and a device together. If zaphod isn't using this information then why not? If it's simply because no one has fixed it yet then fair enough but you're making it sound like it can't be done with the current syntax?

    Comment


    • #12
      It could be done, but it's not done at the moment. Patches welcome.

      Comment


      • #13
        I finally got around to looking into this myself. I've been working my way through xorg-server's InitOutput and the driver's RADEONPreInit_KMS functions, adding debug statements to get a feel for what's going on.

        The most interesting thing I discovered is that even though the PreInit function gets called twice, once for each screen, the pScrn pointer actually points to Screen0 both times. This may be a problem with the way that probed screens are matched to the configured screens. I hardcoded the matching to see what would happen and while PreInit did get called on Screen1, it still used the wrong monitors. I now think the problem lies deeper, something to do with the entity lists. I'll try and find out soon.

        Comment


        • #14
          Ahaha! I did it! Really happy right now.

          I came to realise where the monitors were really being selected. I figured the best way to link the probed monitors to the ones listed in xorg.conf would be to do it by name. I think this is what fglrx does. So instead of relying on zaphod_mask, as was previously the case, the drmmode_output_init function now returns early if pScrn->monitor->id doesn't match the name that's just been generated. Bingo!

          This does still rely on pScrn ponting to the right screen section so the problem in the above post will also need to be fixed. I still have it hardcoded right now. Once I've figured that part out, I'll send Alex a patch. I'm still not sure exactly how zaphod_mask is supposed to work but he'll know what to do.

          Comment


          • #15
            Originally posted by Chewi View Post
            The most interesting thing I discovered is that even though the PreInit function gets called twice, once for each screen, the pScrn pointer actually points to Screen0 both times.
            That's how zaphod works any why it's kind of a PITA to deal with. The driver loads twice for the same device, so each instance has to be aware of the other and make sure not to step on each others feet. It's better with KMS since the drm controls the hw and each instance of the X driver would just request calling into the drm rather than trying to bang the hw itself.

            Comment


            • #16
              It's the same physical device underneath it all but it doesn't necessarily have to be the same device section in xorg.conf, does it? Semantically, I suppose it would make sense to have one device section shared between two screen sections but that doesn't seem to be the convention.

              Comment


              • #17
                Originally posted by Chewi View Post
                It's the same physical device underneath it all but it doesn't necessarily have to be the same device section in xorg.conf, does it? Semantically, I suppose it would make sense to have one device section shared between two screen sections but that doesn't seem to be the convention.
                For zaphod, you need two device sections since from X's perspective, it's loading on two "cards" which is how you end up with "independent" heads. You have to specify the same busid and different screen numbers in the device sections. So the driver loads twice, once for each device instance in your config.

                Comment


                • #18
                  Okay, I agree with that, but what you said earlier seemed to imply that Screen0 is supposed to be passed to PreInit twice? Maybe that's not what you meant. Surely it's Screen1 (which is tied to Card1) that is supposed to be passed the second time. If this is correct then I'll continue to investigate exactly why this isn't happening.

                  Comment


                  • #19
                    Originally posted by Chewi View Post
                    Okay, I agree with that, but what you said earlier seemed to imply that Screen0 is supposed to be passed to PreInit twice? Maybe that's not what you meant. Surely it's Screen1 (which is tied to Card1) that is supposed to be passed the second time. If this is correct then I'll continue to investigate exactly why this isn't happening.
                    Yes, separate screen pointers for each instance.

                    Comment


                    • #20
                      Originally posted by Chewi View Post
                      This does still rely on pScrn ponting to the right screen section so the problem in the above post will also need to be fixed. I still have it hardcoded right now. Once I've figured that part out, I'll send Alex a patch. I'm still not sure exactly how zaphod_mask is supposed to work but he'll know what to do.
                      Great work Chewi . I've been waiting a long time for this, I hope it'll hit mainstream soon!

                      Comment

                      Working...
                      X