Closed mattmacy closed 8 years ago
Hi!
The problem is an incompatibility between the struct sg_table
and struct sg_list
types:
i915_ggtt_insert_entries
passes a struct sg_table
to (agp_)intel_gtt_insert_sg_entries
: https://github.com/FreeBSDDesktop/freebsd-base-graphics/blob/drm-next-4.6/sys/dev/drm2/i915/i915_gem_gtt.c#L2559agp_intel_gtt_insert_sg_entries
expects a struct sg_list
: https://github.com/FreeBSDDesktop/freebsd-base-graphics/blob/drm-next-4.6/sys/dev/agp/agp_i810.c#L2236Obviously walking the list of segments doesn't make any sense. On my laptop, it tries to map around 3 GiB of data instead of the expected 128 kiB. I have no idea why the compiler doesn't complain loudly.
The implementation of agp_intel_gtt_insert_sg_entries
is buggy too (this code is not used in HEAD) here: https://github.com/FreeBSDDesktop/freebsd-base-graphics/blob/drm-next-4.6/sys/dev/agp/agp_i810.c#L2245-L2247
Ie. it increments j
and checks its value against sg_nsegs
, however, it uses i
to actually access the sg_segs
array.
I will fix those two issues tomorrow or Wednesday and come back to you.
There are still stray writes but I can actually run X now.
All the frame buffer attributes are the same in both 3.8 and 4.6 which is why it's very odd that bzero'ing it after mapping appears to overwrite many thread stacks causing the system to fail rather spectacularly. @dumbbell can you take a look?