On Wed, Jan 11, 2017 at 09:51:02PM +0000, Chris Wilson wrote: > Since the partial offset must be page aligned, we can use those low 12 > bits to encode the size of the partial view (which then cannot be larger > than 8MiB in pages). A requirement for avoiding unused bits inside the > struct is imposed later by avoiding the clear of the struct (or of > copying around static initialisers). This is easier to guarantee by > manual packing into a single u64 - the presence of the u64 inside a > struct causes gcc to pad the struct out to a u64 boundary, even if we > use the __packed attribute. I made a mistake in my testing. :| I assked gcc whether struct {u64; u32;} was the same size as a u64. If we ask gcc whether struct {u64; u32;} is 12 bytes, all we need is the __packed attribute. -Chris -- Chris Wilson, Intel Open Source Technology Centre _______________________________________________ Intel-gfx mailing list Intel-gfx@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/intel-gfx