Author Topic: Console Response After Running X  (Read 13800 times)

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Console Response After Running X
« Reply #15 on: August 03, 2006, 10:09:40 am »
OK, for now I have put out the word on arm@openbsd.org whilst I rebuild my environment using OpenBSD 4.0. Started from scratch since it has been upgraded quite a lot and was long overdue.

Will take a look at it again as soon as X has finished building.

-Andy
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Console Response After Running X
« Reply #16 on: August 05, 2006, 12:15:39 pm »
I think I have a reasonable handle on what is causing this to happen now, although there are some areas of complexity that I need to understand and the PXA270 programmers guide is tough reading.

Basically the console is handled as follows..

wsdisplay interfaces with pxa2x0_lcd.c and the function pxa_lcd_new_screen is used to create the memory map for the display (using bus_dmamem_alloc) and then map that into a kernel virtual address using bus_dmamem_map. This address becomes the internal frame buffer address that is  used to render the text consoles which are actually implemented through the rasops library since the display is bitmap only.

When the dma map is created to give the kernel the address of the buffer a particular flag is used, BUS_DMA_COHERENT, which should ensure that writes to this region are immediately sent to the device on the other end of the DMA channel (the display).

As long as you are working in text mode and don't change anything then the frame buffer DMA doesn't get upset.

To access the bitmap display from userland such that graphical applications function it is necessary to perform two steps, step one is to send an IOCTL to the frame buffer to say that it should go into dumb mode (theoretically this should perform extra initialisations and store some flag information for the system to say that the normal text display isn't available any more) and then a call to the system call mmap is used to obtain a memory mapped region with which to communicate with the display.

The mmap call is implemented again in pxa2x0_lcd.c and what it actually does is very simply to use bus_dmamem_mmap to obtain another virtual address region corresponding to the previously allocated buffer created in pxa_lcd_new_screen. This is necessary since a process virtual address space will be different to the kernel virtual address space. This call is made, again, using the BUS_DMA_COHERENT flag to ensure that anything written to this region is immediately written to the device on the other end of the DMA channel.

bus_dmamem_mmap/map deals with virtual addresses but I suspect that, since the DMA controller of the PXA is  an integrated device, it also deals with descriptors that map virtual addresses to physical addresses. This being the case what happens when a second descriptor is created to a region for transfer when a descriptor already exists? (as in the case of bus_dmamem_mmap during mmap call following bus_dmamem_map during text frame buffer creation) - my suspicion at this stage is that the controller will handle only the last initialised DMA transfer in a coherent state. This would explain why a return to the text buffer starts to experience transfer slowness in the rasops library that is used to render the text display. (upon return the kernel bitmap used for this display is no longer flagged coherent and is subject to writeback cache built into the DMA controller).

I hope to fix this by implementing an IOCTL handler within the pxa2x0_lcd.c for the WSDISPLAY_SMODE message that restores the coherency to the original (kernel) bitmapped region used by the rasops functions so that this region returns to its original snappy state. This is the area that I am tinkering with at the moment.

-Andy
« Last Edit: August 05, 2006, 01:59:02 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Console Response After Running X
« Reply #17 on: September 16, 2006, 09:14:00 am »
Have you had any luck sorting this out?  

Quote
controller).

I hope to fix this by implementing an IOCTL handler within the pxa2x0_lcd.c for the WSDISPLAY_SMODE message that restores the coherency to the original (kernel) bitmapped region used by the rasops functions so that this region returns to its original snappy state. This is the area that I am tinkering with at the moment.

-Andy
[div align=\"right\"][a href=\"index.php?act=findpost&pid=137519\"][{POST_SNAPBACK}][/a][/div]

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Console Response After Running X
« Reply #18 on: May 06, 2007, 08:33:33 am »
Quote
I'm running a 03-Jun-06 snap, but I noticed this behavior on the 3.9 release as well.

When I run startx (or startxfec4) from the console and subsequently quit X and return to the console, response sucks; noticeable lag echoing typed characters, etc.  It's bad enough that I have to reboot to get a normal acting console again.

Anyone else seeing this?  Is there a cure?  (Other than always rebooting after X, that is...)

-jw-
This has been fixed in 4.1-current .

Antikx

  • Hero Member
  • *****
  • Posts: 1147
    • View Profile
    • http://tyrannozaurus.com
Console Response After Running X
« Reply #19 on: May 06, 2007, 08:54:53 am »
hmmm.. what ever happened to Iamasmith...
Kanpai,
-Antikx (Twitter, Mugshot and PodNova)
C1000 - pdaXrom R198 (Celestial Environment)
tyrannozaurus.com
[img]http://www.tyrannozaurus.com/files/category_pictures/general_1.png\" border=\"0\" class=\"linked-sig-image\" /]
Zaurus news/blogs feed from Zaurus users
Free Windows, Linux, or Web RSS readers.
Featured pages at tyrannozaurus:
Sharp Petition, ScummVM, Cacko, pdaXii13, and Celestial Environment

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Console Response After Running X
« Reply #20 on: May 06, 2007, 08:57:22 am »
Quote
hmmm.. what ever happened to Iamasmith...
He still posts every once and awhile.
« Last Edit: May 06, 2007, 08:57:36 am by mathemajikian »

ZDevil

  • Hero Member
  • *****
  • Posts: 1998
    • View Profile
    • http://
Console Response After Running X
« Reply #21 on: May 12, 2007, 11:24:09 am »
Quote
Quote
I'm running a 03-Jun-06 snap, but I noticed this behavior on the 3.9 release as well.

When I run startx (or startxfec4) from the console and subsequently quit X and return to the console, response sucks; noticeable lag echoing typed characters, etc.  It's bad enough that I have to reboot to get a normal acting console again.

Anyone else seeing this?  Is there a cure?  (Other than always rebooting after X, that is...)

-jw-
This has been fixed in 4.1-current .
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160589\"][{POST_SNAPBACK}][/a][/div]

It seems the issue is still there. Now I am using 4.1 kernel GENERIC#55 (= the 4.1 official release).
Still experiencing lag in console after exiting X.  
But this is not as a big problem as the suspend issue (in the 4.1 snapshots).

Life is too precious for hacking *too much*
Visit my Z screencap gallery[/color]
My EeePC 701 Black = Debian (Lenny) on IceRocks + Transcend SDHC Class6 8GB + 2GB RAM
My Zaurus SL-C3200 = Debian EABI (kernel 2.6.24.3-yonggun) on a swapped internal Sandisk Extreme III CF 16gb
My Debian EABI feed: http://matrixmen.free.fr/zaurus/debian/
My OpenBSD/Zaurus feeds:  Link1, Link2
[/i][/font][/color][/size]

mathemajikian

  • Sr. Member
  • ****
  • Posts: 301
    • View Profile
    • http://exit3.i-55.com/~xikon/openbsdzaurus.html
Console Response After Running X
« Reply #22 on: May 12, 2007, 01:43:26 pm »
Quote
It seems the issue is still there. Now I am using 4.1 kernel GENERIC#55 (= the 4.1 official release).
Still experiencing lag in console after exiting X. 
But this is not as a big problem as the suspend issue (in the 4.1 snapshots).

Wow! I must have the golden Zaurus.  Did you remember if you had the lag issue in --current? Try and use this ttys file and see if it persists:

 [ Invalid Attachment ]  [span style=\'font-size:8pt;line-height:100%\'] rename the file to ttys and put it in /etc/ then reboot. Does the lag problem still exist?[/span]

Can anyone else verify that this problem is no longer present in 4.1 --current?
« Last Edit: May 12, 2007, 03:00:09 pm by mathemajikian »

jpmatrix

  • Hero Member
  • *****
  • Posts: 1014
    • View Profile
    • http://matrixmen.free.fr
Console Response After Running X
« Reply #23 on: May 12, 2007, 05:22:24 pm »
Quote
Quote
It seems the issue is still there. Now I am using 4.1 kernel GENERIC#55 (= the 4.1 official release).
Still experiencing lag in console after exiting X. 
But this is not as a big problem as the suspend issue (in the 4.1 snapshots).

Wow! I must have the golden Zaurus.  Did you remember if you had the lag issue in --current? Try and use this ttys file and see if it persists:

 [ Invalid Attachment ]  [span style=\'font-size:8pt;line-height:100%\'] rename the file to ttys and put it in /etc/ then reboot. Does the lag problem still exist?[/span]

Can anyone else verify that this problem is no longer present in 4.1 --current?
[div align=\"right\"][a href=\"index.php?act=findpost&pid=161173\"][{POST_SNAPBACK}][/a][/div]

i'm using 4.1 GENERIC#89 and i haven't seen it although i'm used to go forth and back from  X to console
**Fujitsu U1010 !!!  
**ex-Zaurus SL-C3000 owner with Debian kernel 2.6.24-yonggun

iamasmith

  • Hero Member
  • *****
  • Posts: 1248
    • View Profile
Console Response After Running X
« Reply #24 on: May 12, 2007, 06:33:49 pm »
Quote
Quote
hmmm.. what ever happened to Iamasmith...
He still posts every once and awhile.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=160592\"][{POST_SNAPBACK}][/a][/div]

Heh, I'm still here and listening in from time to time. However, I have been contracting for about 9 months now and am pretty focussed upon that so I don't have as much time to tinker.

I'm working in a more strategic field right now and technology is only a small part of the problems that I face.

I will post when I can and hope to start contributing to OpenBSD again at some point... incidently - I believe that the console problems aren't fixed. What they have done is made X run on Console #2 and switch to screen 2 whilst running X.

The X server still seems to screw up the frame buffer. I believe there is still an  outstanding problem with the DMA cache coherency.

BTW: I'm really sorry that I didn't follow up on Theo's request to nag the committers to include a variant of my Caps lock fixes for Kernel and X on 4.1. I have just been soooo busy. The good news is that they still seem to apply without any problems

-Andy
« Last Edit: May 12, 2007, 06:38:41 pm by iamasmith »
OpenBSD 4.2 -current on full 4Gb of SL-C3000
Microdrive replaced with 4Gb SanDisk Extreme III card