On Mon, 2010-05-17 at 20:37 +0200, Gerd Hoffmann wrote: > On 05/17/10 11:54, Alexander Larsson wrote: > > >> @@ -9138,7 +9086,7 @@ static inline void > >> handle_dev_create_primary_surface(RedWorker *worker) > >> } > >> > >> red_create_surface(worker, 0, surface.width, surface.height, > >> surface.stride, surface.format, > >> - line_0); > >> + line_0, 1); > > > > Maybe add a comment saying why we data_is_valid is needed for primary > > surfaces. > > Needed only in the save/restore case. Not fully sure it is really ok to > do it unconditionally, although I can't think of a reason why it > shouldn't. Comments? > > The alternative would be to do it depending on some bit in surface.flags.
I think what we want to do is: 1) By default, don't zero out data, its just a waste of cycles. However, also don't guarantee that the data is kept (as that would require a data upload to texture memory for a GL canvas). So, we give no guarantees at all about surface contents after creation, each canvas doing minimal work. 2) Add a flag to surface.create to keep the data. This is a no-op on the sw canvas but an upload on the gl backend. Some driver may want to use this if a new surface has data in it to avoid having to send a separate DrawImage to fill it. 3) Have the restore case override this flag like your code code above does when recreating the surfaces. (I.e. it doesn't actually change the flags value in the stored CreateSurface commands) _______________________________________________ Spice-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/spice-devel
