Home | History | Annotate | Line # | Download | only in dist
TODO revision 1.1
      1  1.1  mrg - Acceleration
      2  1.1  mrg 	- Blits and solid fill
      3  1.1  mrg 
      4  1.1  mrg   - XAA and the shadow buffer will not work together, because the
      5  1.1  mrg     shadow buffer updates in the block handler, so if we got any XAA
      6  1.1  mrg     calls in between, things would get messed up. 
      7  1.1  mrg 
      8  1.1  mrg     Current plan:
      9  1.1  mrg 	- Add our own damage tracker that produces raw rectangles
     10  1.1  mrg 	- Whenever it fires, submit the copy immediately
     11  1.1  mrg 
     12  1.1  mrg 	- Wrap the necessary ops in such a way that the original
     13  1.1  mrg 	  implementation gets called first. The original implementation
     14  1.1  mrg 	  will use fb, which will produce damage, which will get
     15  1.1  mrg 	  submitted.
     16  1.1  mrg 
     17  1.1  mrg 	  If we decide to accelerate a particular operation, first set
     18  1.1  mrg           a flag that the immediately following damage event should not
     19  1.1  mrg 	  result in spice protocol being sent. Ie., 
     20  1.1  mrg 
     21  1.1  mrg 	  on_op:
     22  1.1  mrg 		qxl->enable_copying = FALSE
     23  1.1  mrg 
     24  1.1  mrg 		call original;
     25  1.1  mrg 
     26  1.1  mrg 		send acceleration command
     27  1.1  mrg 
     28  1.1  mrg 		qxl->enable_copying = TRUE
     29  1.1  mrg 
     30  1.1  mrg 	  Note damage is added before the drawing hits the framebuffer, so
     31  1.1  mrg 	  it will have to be stored, then cleared
     32  1.1  mrg 		- in a block handler
     33  1.1  mrg 		- before accelerating
     34  1.1  mrg 
     35  1.1  mrg 	  Ie., 
     36  1.1  mrg 
     37  1.1  mrg 	  on_op:
     38  1.1  mrg 		clear damage
     39  1.1  mrg 		disable damage reporting
     40  1.1  mrg 		call original (this will generate unreported damage and
     41  1.1  mrg 			paint to the shadow)
     42  1.1  mrg 		submit command
     43  1.1  mrg 		enable damage
     44  1.1  mrg 
     45  1.1  mrg 	   It may be possible to use the shadow code if we added a
     46  1.1  mrg 	   shadowReportNow() that would report any existing
     47  1.1  mrg 	   damage. Ie., basically export shadowRedisplay()
     48  1.1  mrg 
     49  1.1  mrg     1. Get damage added, out of CreateScreenResources
     50  1.1  mrg     2. Make sure it works
     51  1.1  mrg     3. Submit copies and disable shadow
     52  1.1  mrg     4. Delete shadow
     53  1.1  mrg     5. Wrap some of the ops, or use XAA?
     54  1.1  mrg 
     55  1.1  mrg     The input we get is:
     56  1.1  mrg 
     57  1.1  mrg 	- First a damage notification: "I am going to draw here"
     58  1.1  mrg 	- Then maybe an exa notification
     59  1.1  mrg 
     60  1.1  mrg 	So the algorithm is. 
     61  1.1  mrg 
     62  1.1  mrg 	Maintain a "to_copy" region to be copied into the device
     63  1.1  mrg 
     64  1.1  mrg 	- in damage, if there is anything in to_copy, copy it
     65  1.1  mrg 
     66  1.1  mrg 	- in block handler, if there is anything in to_copy, copy it
     67  1.1  mrg 
     68  1.1  mrg 	- in exa, if we manage to accelerate, delete to_copy.
     69  1.1  mrg 
     70  1.1  mrg 	Unfortunately, for core text, what happens is
     71  1.1  mrg 		- damage is produced for the glyph box
     72  1.1  mrg 		- solid fill is generated
     73  1.1  mrg 		- the glyph is drawn
     74  1.1  mrg 	And the algorithm above means the damage is thrown away.
     75  1.1  mrg 
     76  1.1  mrg - Coding style fixes
     77  1.1  mrg 
     78  1.1  mrg - Better malloc() implementation
     79  1.1  mrg 	- Take malloc() from the windows driver?
     80  1.1  mrg 	- Put blocks in a tree?
     81  1.1  mrg 
     82  1.1  mrg - Find out why it picks 8x6 rather than a reasonable mode
     83  1.1  mrg  - Possibly has to do with the timings it reports. RandR only
     84  1.1  mrg    allows 8x6 and 6x4.
     85  1.1  mrg 
     86  1.1  mrg - Only compile mmtest if glib is installed
     87  1.1  mrg 	Or maybe just get rid of mmtest.c
     88  1.1  mrg 
     89  1.1  mrg - Notes on offscreen pixmaps
     90  1.1  mrg 
     91  1.1  mrg   Yaniv says that PCI resources is a concern and that it would be better
     92  1.1  mrg   if we can use guest memory instead of video memory. I guess we can
     93  1.1  mrg   do that, given a kernel driver that can allocate pinned memory.
     94  1.1  mrg 
     95  1.1  mrg 	- If/when we add hardware acceleration to pixman, pixman will need to
     96  1.1  mrg 	  generate QXL protocol. This could be tricky because DRM assumes that
     97  1.1  mrg 	  everything is a pixmap, but qxl explicitly has a framebuffer. Same 
     98  1.1  mrg 	  goes for cairo-drm. 
     99  1.1  mrg 
    100  1.1  mrg - Hashing
    101  1.1  mrg 
    102  1.1  mrg   QXL has a feature where it can send hash codes for pixmaps. Unfortunately
    103  1.1  mrg   most of the pixmaps we use are very shortlived. But there may be a benefit
    104  1.1  mrg   for the root pixmap (and in general for the (few) windows that have
    105  1.1  mrg   a pixmap background).
    106  1.1  mrg 
    107  1.1  mrg   - When copying from pixmap to framebuffer, right now we just copy
    108  1.1  mrg     the bits from the fb allocated pixmap.
    109  1.1  mrg 
    110  1.1  mrg   - With hashing, we need to copy it to video memory, hash it, then set the
    111  1.1  mrg     "unique" field to that hash value (plus the QXL_CACHE
    112  1.1  mrg     flag). Presumably we'll get a normal remove on it when it is no
    113  1.1  mrg     longer in use.
    114  1.1  mrg 
    115  1.1  mrg   - If we know an image is available in video memory already, we should just
    116  1.1  mrg     submit it. There is no race condition here because the image is
    117  1.1  mrg     ultimately removed from vmem by the driver.
    118  1.1  mrg 
    119  1.1  mrg     (Note hash value could probably just be XID plus a serial number).
    120  1.1  mrg 
    121  1.1  mrg   - So for the proof of concept we'll be hashing complete pixmaps every time
    122  1.1  mrg     we submit them.
    123  1.1  mrg 
    124  1.1  mrg - Tiles
    125  1.1  mrg 
    126  1.1  mrg   It may be beneficial to send pixmaps in smaller tiles, though Yaniv
    127  1.1  mrg   says we will need atomic drawing to prevent tearing.
    128  1.1  mrg 
    129  1.1  mrg - Video
    130  1.1  mrg 
    131  1.1  mrg   We should certainly support Xv. The scaled blits should be sent
    132  1.1  mrg   as commands, rather than as software. Does spice support YUV images?
    133  1.1  mrg   If not, then it probably should.
    134  1.1  mrg 
    135  1.1  mrg - Multi-monitor:
    136  1.1  mrg 
    137  1.1  mrg   - Windows may not support more than dual-head, but we do support more than
    138  1.1  mrg     dual-head in spice. This is why they do the multi-pci device.
    139  1.1  mrg 
    140  1.1  mrg     Ie,. the claim is that Yaniv did not find any API that would
    141  1.1  mrg     support more than two outputs per PCI device. (This seems dubious
    142  1.1  mrg     given that four-head cards do exist).
    143  1.1  mrg 
    144  1.1  mrg   - Linux multi-monitor configuration supports hotplug of monitors,
    145  1.1  mrg     and you can't make up PCI devices from inside the driver.
    146  1.1  mrg 
    147  1.1  mrg   - On windows the guest agent is responsible for setting the monitors
    148  1.1  mrg     and resolutions.
    149  1.1  mrg 
    150  1.1  mrg   - On linux we should support EDID information, and enabling and
    151  1.1  mrg     disabling PCI devices on the fly is pretty difficult to deal with
    152  1.1  mrg     in X. Ie., we would need working support for both GPU hotplug and
    153  1.1  mrg     for shatter. This is just not happening in RHEL 5 or 6.
    154  1.1  mrg 
    155  1.1  mrg   - Reading back EDID over the spice protocol would be necessary
    156  1.1  mrg     because when you hit detect displays, that's what needs to happen.
    157  1.1  mrg 
    158  1.1  mrg Better acceleration:
    159  1.1  mrg 
    160  1.1  mrg - Given offscreen pixmaps, we should get rid of the shadow framebuffer.
    161  1.1  mrg   If we have to fall back to software, we can use the drawing area to 
    162  1.1  mrg   get the area in question, then copy them to qxl_malloced memory,
    163  1.1  mrg   then draw there, then finally send the bits.
    164  1.1  mrg 
    165  1.1  mrg -=-=-=-=-
    166  1.1  mrg 
    167  1.1  mrg Done:
    168  1.1  mrg 
    169  1.1  mrg Question:
    170  1.1  mrg 
    171  1.1  mrg - Submit cursor images
    172  1.1  mrg 
    173  1.1  mrg - Note: when we set a mode, all allocated memory should be considered
    174  1.1  mrg   released.
    175  1.1  mrg 
    176  1.1  mrg - What is the "vram" PCI range used for? 
    177  1.1  mrg 
    178  1.1  mrg   As I read the Windows driver, it can be mapped with the ioctl
    179  1.1  mrg   VIDEO_MAP_VIDEO_MEMORY. In driver.c it is mapped as pdev->fb, but
    180  1.1  mrg   it is then never used for anything as far as I can tell.
    181  1.1  mrg 
    182  1.1  mrg   Does Windows itself use that ioctl, and if so, for what. The area
    183  1.1  mrg   is only 32K in size so it can't really be used for any realistic
    184  1.1  mrg   bitmaps.
    185  1.1  mrg 
    186  1.1  mrg     It's a required ioctl.  I believe it's needed for DGA-like things.
    187  1.1  mrg     I have no idea how the Windows driver manages syncing for that,
    188  1.1  mrg     but I think we can safely ignore it. [ajax]
    189  1.1  mrg 
    190  1.1  mrg - Hook up randr if it isn't already
    191  1.1  mrg 
    192  1.1  mrg - Garbage collection
    193  1.1  mrg 	- Before every allocation?
    194  1.1  mrg 	- When we run out of memory?
    195  1.1  mrg 	- Whenever we overflow some fixed pool?
    196  1.1  mrg 
    197  1.1  mrg - Get rid of qxl_mem.h header; just use qxl.h
    198  1.1  mrg 
    199  1.1  mrg - Split out ring code into qxl_ring.c
    200  1.1  mrg 
    201  1.1  mrg - Don't keep the maps around that are just used in preinit
    202  1.1  mrg 	(Is there any real reason to not just do the CheckDevice in
    203  1.1  mrg 	 ScreenInit?)
    204  1.1  mrg 
    205  1.1  mrg 
    206