Page 2 of 10 FirstFirst 1234 ... LastLast
Results 11 to 20 of 98

Thread: Zaphod mode with the Open Source Driver?

  1. #11
    Join Date
    Jun 2008
    Location
    Perth, Scotland
    Posts
    436

    Default

    Quote 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?

  2. #12
    Join Date
    Dec 2007
    Posts
    2,371

    Default

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

  3. #13
    Join Date
    Jun 2008
    Location
    Perth, Scotland
    Posts
    436

    Default

    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.

  4. #14
    Join Date
    Jun 2008
    Location
    Perth, Scotland
    Posts
    436

    Default

    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.

  5. #15
    Join Date
    Dec 2007
    Posts
    2,371

    Default

    Quote 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.

  6. #16
    Join Date
    Jun 2008
    Location
    Perth, Scotland
    Posts
    436

    Default

    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.

  7. #17
    Join Date
    Dec 2007
    Posts
    2,371

    Default

    Quote 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.

  8. #18
    Join Date
    Jun 2008
    Location
    Perth, Scotland
    Posts
    436

    Default

    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.

  9. #19
    Join Date
    Dec 2007
    Posts
    2,371

    Default

    Quote 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.

  10. #20
    Join Date
    Jan 2009
    Posts
    148

    Default

    Quote 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!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •