alyssa changed the topic of #panfrost to: Panfrost - FLOSS Mali Midgard & Bifrost - https://gitlab.freedesktop.org/panfrost - Logs https://freenode.irclog.whitequark.org/panfrost - <daniels> avoiding X is a huge feature
vstehle has quit [Ping timeout: 272 seconds]
megi has quit [Ping timeout: 258 seconds]
rcf has quit [Ping timeout: 268 seconds]
davidlt has quit [Ping timeout: 248 seconds]
rcf has joined #panfrost
davidlt has joined #panfrost
hopetech has joined #panfrost
hopetech has quit [Client Quit]
hopetech has joined #panfrost
vstehle has joined #panfrost
davidlt has quit [Remote host closed the connection]
davidlt has joined #panfrost
davidlt has quit [Remote host closed the connection]
davidlt has joined #panfrost
pH5 has joined #panfrost
adjtm_ has quit [Ping timeout: 246 seconds]
megi has joined #panfrost
yann has quit [Ping timeout: 244 seconds]
adjtm_ has joined #panfrost
davidlt has quit [Ping timeout: 245 seconds]
yann has joined #panfrost
raster has joined #panfrost
raster has quit [Read error: Connection reset by peer]
raster has joined #panfrost
<bbrezillon> shadeslayer, alyssa, tomeu: is anyone working on the "allow job pipelining" task?
<bbrezillon> I was about to resume working on it
<robher> bbrezillon: Steven posted a patch on that (if using _NEXT registers is what you mean).
<bbrezillon> robher: not sure, I'll check. I was talking about the job serialization we have in mesa
<daniels> bbrezillon: no-one's picked that up, no
herbmilleriw has quit [Remote host closed the connection]
<bbrezillon> daniels: ok, thx
grw has joined #panfrost
<raster> oh dear
<raster> something regressed....
<daniels> raster: anything in particular?
<raster> buffer age/partial updates
<raster> wetson works ok
<raster> but enlightenment is all messed up
<raster> nothing changed for us in that area
<raster> i just updated mesa+linux-next
<raster> and we havent added support for the new extension you pushed into mesa to pre-declare your update region before you draw
<raster> (forgot the name)
<raster> what i see seems definitely to be "buffer age is not agreeing with backbuffer data content"
<raster> so areas outside the update region are all black
<raster> tho it seesm to leave some trails in some places -
<raster> anyway
<raster> time to hunt
<raster> unfortunately... i dont know if it was kernel or mesa that broke yet. have to figure it out. i guess mesa most likely
<bbrezillon> you can try to revert
<bbrezillon> 0c5633036195 panfrost: Workaround bug in partial update implementation
<bbrezillon> 65ae86b85422 panfrost: Add support for KHR_partial_update()
<raster> oh
<raster> that sames me time :)
<raster> i was going to start a bisecting run :)
<raster> my weston tho will be old-ish so not sure it even has support for this
<raster> so wondering why it didnt break
<raster> yup
<raster> those 2 reverted - it works again
<raster> :)
<bbrezillon> hm
<bbrezillon> can you try to revert only the first one?
<raster> that is my next port of call :)
<bbrezillon> alyssa: I wonder how we end up with damage_{width,height} = 0
<raster> gah
<raster> -Werror is causing it to not compile
<bbrezillon> what's the warning?
<raster> or is it?
<raster> let me do a clean build and see
<raster> i do get lots of warnings
<raster> hmm no - those arent causing it to err. gimme a min
<raster> oh damn what
<raster> i got a conflict?
<raster> how? ...
<raster> how on earth did i revert these before with no conflicts?
<raster> never mind i must have missed something
<raster> ummmm
<raster> it has reverted the wrong thing it seems... wth...
<raster> oh never mind
<raster> i have the revert still her
<raster> with only the earliest of those its still broken
<raster> so the first is the key problem
davidlt has joined #panfrost
<raster> ok
<raster> reading 65ae86b85422 i see the problem
<bbrezillon> raster: can you add traces printing the damage extent in panfrost_draw_wallpaper()
<raster> it ASSUMES apps are using khr partial
<raster> which they will not be because that extension didnt exist for a long tiem
<raster> yet buffer age did
<bbrezillon> normally no
<bbrezillon> I mean, I have a reset_damage_region() call
<raster> let's see
<raster> but my guess is this is wrong/off
<raster> let me undo my reverts and start printf debugging :)
<bbrezillon> I realize we don't do the reset when importing a resource
<bbrezillon> can you try with http://code.bulix.org/tsxqlv-849566 ?
herbmilleriw has joined #panfrost
<raster> yup
<raster> region reported is not "the whole buffer"
<raster> DMG REGION 72,104 -> 616,600
<raster> DMG REGION 568,560 -> 624,600
<raster> DMG REGION 576,544 -> 624,600
<raster> (minx/y -> max/y)
<bbrezillon> hm, so something is calling the ->partial_update() hook
<bbrezillon> raster: what's the res size?
<raster> 1920x1080
<raster> oh wait
<raster> wtf?
<raster> we DO have support for partial update?
<raster> i never through we added it
<raster> wait
<raster> pause
<raster> this may be us
<raster> it was added in 2016...
<raster> well well
<raster> wth...
<raster> i didnt thnik we had it...
<raster> we've been doing this in x11, wayland clients and drm/kms ever since then
<bbrezillon> still doesn't explain why it doesn't work :)
<raster> i'm digging
<mmind00> urjaman: just saw in the logs that you seem to be doing x11 with panfrost ... any hints on what needs to be set? It seems to find panfrost for glamor, but things like glmark-es2 still seem to fall back onto llvmpipe ... glmark2-es2-drm works fine though, so it looks like some sort of x11 setting I'm missing
<alyssa> mmind00: What does es2_info say?
<urjaman> also i wouldnt know for i didnt try glmark (and i'm not running x11 w/ panfrost right now)
<daniels> raster: are you sure your partial_update use is correct? :)
<raster> i'm checking
<bbrezillon> daniels: I'm also not sure my partial_update() implementation is correct :)
<raster> it seems to be
<raster> i was just tracing our regions higher up the stack
<raster> they match the geometry that min/max x/y region give
<raster> a small snippet of debug:
<raster> BUFFER AGE: 2
<raster> MASTER CLIP 72 104 8x24
<raster> SWAP TIME...
<raster> REGION SET 72 104 8x24
<raster> DMG REGION 72,104 -> 80,128
<raster> the DMG REGION is from inside mesa
<bbrezillon> raster: did you try with after adding the missing damage_reset() call in panfrost_resource_from_handle()?
<bbrezillon> raster: BTW, what are the symptoms?
<raster> oh no
<raster> not yet
<raster> umm
<raster> a black screen with some trails of update reagions
<raster> with 1 frame seemingly mostly correct
<raster> (most of the screen redrew)
<raster> its just "buffer age/partial update" smells all over it :)
<bbrezillon> well, if reverting 65ae86b85422
<raster> gimme a bit
<raster> going ot get more debug
<bbrezillon> make it work, it's definitely related to partial-update :)
<raster> ki wonder if perhaps we call eglSetDamageRegionKHR multiple times per draw/swap
<raster> let me check
<raster> like set it up for 1region, then draw
<raster> then another, then draw
<raster> nope. we set them all up in advance in one go
<raster> would our scissor clips be the issue?
<raster> we specifically also set up scissor clips to be our update region
<raster> ?
<raster> interesting
<bbrezillon> can you check the fine rendering region (batch->{minx,maxx,miny,max}) in draw_wallpaper()?
<raster> when we set a single update region this code does the right yhing for mg region
<raster> when we setup > 1 ... it drops back to "full update"
<raster> was that the intent?
<mmind00> urjaman: but you didn't do anything specific I guess?
<bbrezillon> raster: nope
<mmind00> urjaman: I'm just guessing that I must be missing something very basic
<raster> :)
<daniels> raster: just to be clear, you know that partial_update and swap_buffers_with_damage take totally different regions, right?
<bbrezillon> raster: you mean several rects passed to a single partial_update() call?
<bbrezillon> or several calls to to partial_update()?
<raster> the logic reading this does seem to only handle 1 region for update
<daniels> the partial_update spec has a pretty good visual explanation, and after writing a buggy Weston implementation, I went through and commented the hell out of all the surrounding code to explain the region juggling we go through
<raster> daniels: i know - for us they have always been 1:1
<daniels> ok, that's incorrect :)
<daniels> SwapBuffersWithDamage takes _surface-relative_ damage - the change relative to the last time you called SwapBuffers(WithDamage)
<daniels> SetUpdateRegion takes _buffer-relative_ damage - the region you're intending to change relative to the last time you _used that buffer_
<raster> oh
<raster> for us i think that doesnt matter because we "accumulate"
<raster> let me mull it over but i think i've been here before
<daniels> so your swap region is going to be driven by only the area you're redrawing in that cycle; the partial-update region needs to look at buffer_age, and accumulate all the damage back to the last time that buffer was current
<raster> so if we're triple buffering our update region is this frame + last frame +_ frame before that
<raster> so we kind of redraw a moving window across N frames
<urjaman> mmind00: i did that revert that anarsoul linked above to get glamor (or even mpv) to eglInitialize() but that shouldnt have an effect if you have glamor working ...
<daniels> right
<raster> its not as efficient as it could be
<raster> but it kind of side-steps these issues .. i think...
<raster> (and if buffer age ever changes from being a constant value we throw our hands in the air and do a full redraw for that frame thus throwing in a full update in the pipeline if there is a hiccup)
<raster> so let me think
<raster> yeah a quick mull makes me think its moot due to the "over n frame accumulate" thing
<grw> hiya- is panfrost known to work/not work on amlogic s912?
<grw> i get this on boot- https://pastebin.com/xJ7JA3c7
<grw> using 5.3.0-rc6
<daniels> grw: unfortunately it is currently known to not work on T820/AmLogic
<grw> daniels: thanks :)
<grw> i remember seeing demo running on s912 a while back, guess there is some regression
davidlt has quit [Ping timeout: 246 seconds]
<daniels> yeah, unfortunately amlogic support has been a bit neglected over the past couple of months, so it's regressed pretty badly
<daniels> the only working platform we have right now is T860, as found in RK3399
<daniels> the T760 in RK3288 is semi-working, and the T820 in S921 should also be not _too_ far away from working
<daniels> we're hoping over the next few weeks to get T720, T760, and T860, into workable shape
<grw> hm i see, thanks. if i can help test anything let me know :)
<daniels> will do, but at this point the most help would be being adventurous and stepping in to do the fixing ;)
<anarsoul> urjaman: do clean rebuild, revert is not necessary
<urjaman> ok i'll try to remember that next time i test
<grw> will take a look to see where my error come from but im afraid its beyond my abilities to fix
<raster> so let's assume 0 == actual updates for the current frame
<raster> thats where things changed this frame
<raster> 1 == what changes 1 frame ago
<raster> and 2 == 2 frames ago
<raster> every draw we actually have a sliding window and we actually draw the union of 0, 1, 2
<raster> but the 1, 2 regions have no actual changes in them - tis dumbly repainging what was drawn a frame ago
<raster> in general this isnt actually that bad in performance as most of the time those regiosn tend to be very close together or identical. but let's leave that aside
<raster> i dont think this would break the partial update as such if it was per buffer not per surface
<daniels> right, that's the only correct implementation if you don't have EGL_SWAP_BEHAVIOR_PRESERVED
<raster> in this case we can actually dumbly keep them 1:1
<daniels> you have to redraw the union regardless - you can optimise to only pass 0 to SwapBuffersWithDamage, but you have to pass (0 u 1 u 2) to both actual redraw as well as partial_update
<raster> so as best i can tell here... we're submitting the right stuff if we are assuming regions 2, 1 are dumb "what was there before anyway" paints
<raster> yeah
<raster> we definitely could optimize the last bit for sure
<raster> but it's been kind of moot in real life data so never bothered out of simplicity :)
<daniels> (this is assuming that your buffer_age query returns 2)
<raster> so my mulling is... wer're doing the right thing...
<raster> am i wrong?
<raster> i just want to not hunt in the wrong place
<raster> yeah
<raster> its returning 2
<raster> so my debug says
<raster> the -- is my printf inside panfrost_draw_wallpaper()
<raster> anyway
<raster> the rest was from the gl engine code where its setting a bunch of regions (0, 1, 2) in one submission to eglSetDamageRegionKHR
<daniels> co-ord system is the right way up?
<raster> the master clip is our max possible scissor clip size per region we draw as we draw each
<raster> yeah
<raster> 0, 0 is top-left
<raster> :)
<raster> none of that gl goofiness :)
<raster> we set up transforms accordingly so we can think/work in "right way up" space
<raster> oh wait
<daniels> heh
<daniels> ...
<raster> i swapped amage and batch in my printf
<daniels> partial_update takes GL co-ord space, not display co-ord space
<raster> we convert
<daniels> to lower-left (0,0)
<raster> _glcoords_convert() does that
<raster> also handles rotations too
<daniels> for partial_update
<raster> we do that when sticking them on the rect list
<raster> actually i see the problem
<raster> --panfrost: rsrc: 0 0 1920x1080 | dmg: 0 0 1920x1080 | batch: 0 0 1920x1080
<raster> that does not matuch up with the small rects we submitted for our partial update rects
<daniels> rects
<raster> oh
<raster> hmm
<raster> then its right
<daniels> The list should consist of <n_rects> groups of four values, with each group representing a single rectangle in surface coordinates in the form {x, y, width, height}. Coordinates are specified relative to the lower left corner of the surface. It is not necessary to avoid overlaps of the specified rectangles.
<raster> bbl
<raster> meeting
<daniels> don't worry if the damage co-ords are larger - for various reasons we don't submit each rect to reload as separate reload jobs, but we just take the largest possible union area and reload that
<shadeslayer> quick question, I noticed that we can have up to 4 color buffers attached to a panfrost job, but we check for one color buffer here https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/gallium/drivers/panfrost/pan_context.c#L159-161
<shadeslayer> should that check instead be >=1 instead?
<bbrezillon> daniels: that's not entirely true
<shadeslayer> or, actually, <= 1
<bbrezillon> daniels: we actually pick the biggest damage region and relaod around this damage box
<bbrezillon> so there might be up to 4 reload jobs (the 4 rects surrounding the biggest damage box)
<bbrezillon> and of course, we limit the rendering area to the union of all damage rects so we don't have to reload the whole FB
<daniels> bbrezillon: yeah, correct, that was a glib and incorrect description
<daniels> the point being that we are very pessimistic at reload, so may reload a larger region than required
<bbrezillon> for sure
<daniels> but that's correct if not maximally performant
<narmstrong> trying to understand why `if (cfg->ias != 48 || cfg->oas > 40)` doesn't pass anymore on T820
<daniels> narmstrong: there's a thread about that
<narmstrong> daniels: oh
<narmstrong> must have missed it
<shadeslayer> well, I guess what I'm asking is, a context can have more than one colour buffer attached right?
<narmstrong> daniels: oh, ok, but I don't understand why it worked without this at some point.... thanks for the pointer
<daniels> narmstrong: i've made many mistakes in my life, but knowing too much about MMUs isn't one of them
<daniels> shadeslayer: yeah, it can, but on the other hand Panfrost doesn't actually support simultaneous emission to multiple render targets
<daniels> the hardware doesn't support it, so we have to emulate it by running the fragment shader multiple times, masking the outputs so we write to one cbuf at a time
<narmstrong> daniels: no offense ! I only understand the basic concepts of IOMMU, I'm only wondering why it worked as-in on the initial panfrost patchset, and now no more, but it seems this `ias` check was there already...
<daniels> narmstrong: no no, absolutely no offence taken! :) i'm very happy & comfortable with not knowing the details of Arm MMUs. my brain is already full enough with random crap.
<daniels> narmstrong: so why it's regressed I have no idea ...
<narmstrong> I'll need a serious bisect now :-)
<daniels> shadeslayer: i couldn't tell you which part was incorrect
<shadeslayer> ok, so at least they're definitely at odds with each other?
<shadeslayer> alyssa: ^^ thoughts?
megi has quit [Ping timeout: 245 seconds]
<alyssa> shadeslayer: If there are multiple cbufs attached, it can't be scanout; MRT must be off-screen
<alyssa> So the check in context.c#L159 is right
<alyssa> The comment is misleading
<alyssa> daniels: "the hardware doesn't support it, so we have to emulate it by running the fragment shader multiple times, masking the outputs so we write to one cbuf at a time"
<alyssa> On T760+, I'm not sure if this is true
<narmstrong> ok I know now, the initial panfrost had :
<narmstrong> + .ias = 48,
<narmstrong> + .oas = 40,
<shadeslayer> alyssa: I see, any particular reason we only copy 4 cbufs then?
<alyssa> shadeslayer: We only support 4 cbufs
<shadeslayer> alyssa: but PIPE_MAX_COLOR_BUFS is 8 :S
<alyssa> shadeslayer: Yes, but we don't support more than 4 even on chips that do MRT
<alyssa> Desktop OpenGL requires 8 cbufs
<alyssa> OpenGL ES only requires 4, and Mali only does 4 (when it does MRT at all... T720 and T6xx don't do any and have to soft-emulate it)
<alyssa> Could we emulate 8 cbufs? Yes. Do we? No.
davidlt has joined #panfrost
<alyssa> shadeslayer: I mean, it could be, but... it doesn't really matter, if that makes sense?
<alyssa> I would like to leave open the possibility of doing 8 MRT eventually; it's a lot of work but no need to make more
<shadeslayer> alyssa: fair enough
pH5 has quit [Quit: bye]
<mmind00> alyssa: es2_info says ... "libEGL_warning: DRI2: failed to create dri screen"
<alyssa> mmind00: That sounds bad
<alyssa> Are you sure you have glamor enabled?
<mmind00> at least X11 tells me in the log
<mmind00> [ 997.284] (II) modeset(0): glamor initialized
<mmind00> [ 997.284] (II) modeset(0): glamor X acceleration enabled on panfrost
<alyssa> Hmph.
<mmind00> but then the display is nicely non-standard on this scarlet ... with 1536x2048 pixels
<alyssa> scarlet? cute :p
<mmind00> glmark2-es2-drm needed the "--visual-config stencil=1:alpha=0" option though not sure if that figures into it
<mmind00> at least kde-plasma seems inocent ... lxde produces the same behaviour
<alyssa> So this will take the rest of eternity to implement.
<mmind00> "rest of eternity" doesn't sound thaaaat long
<raster> bbrezillon: yeah. the code looked pretty pessimistic reading it it seemed to want to do a bbox basically (well the inverse of one actually)
<anarsoul> alyssa: looks pretty much like utgard to me
<raster> bbrezillon: it seems the damage rect (the one NOT to copy in) doesnt match what we're submitting as regions it seems
yann has quit [Ping timeout: 244 seconds]
<anarsoul> although we don't have condition register
<anarsoul> select takes two slots -- condition is output of smul; branch can consume condition directly (any reg)
<alyssa> anarsoul: Do you have the crazy scheduling reqs?
<anarsoul> like what?
<alyssa> All the VLIW stuff
<alyssa> Because of scheduling alone, the blob is getting better compiles than us
<alyssa> So I aim to fix that today
<alyssa> I feel
<alyssa> frozen not being able to start this um
<alyssa> time to put on some music and start breaking things.
<raster> bbrezillon: what damage_reset() call? cant find one i mesa grepping... ?
<anarsoul> alyssa: yeah, Utgard PP is also VLIW
<alyssa> anarsoul: Good luck.
<anarsoul> it's more or less figured out
<anarsoul> :)
<alyssa> The lgood luck was for writing a scheduler.
<anarsoul> we already do that
<anarsoul> I'm working on merging loads into instruction where it's used
<alyssa> :+1:
<anarsoul> well, "working"
<anarsoul> I know how to do that, but actual work hasn't been started yet
<alyssa> In other news I've seen all of "LUT" "VLUT" and "VSFU" used to refer to the fifth unit in the ALU... not sure which is the real Arm term, I think VLUT but who knows
<alyssa> (I've seen both VLUT and VSFU in public Arm stuff I think? I dunno)
<anarsoul> what is vlut?
<alyssa> anarsoul: vector lookup table
<anarsoul> load uniform/temporary?
<anarsoul> oh
<alyssa> The unit for sin/cos as well as an extra multiplier
<alyssa> The lookup tables are scalar but the multiplier/moves are vector so go figure
<anarsoul> same here
<anarsoul> :)
<anarsoul> we lower sin/cos to scalar for this reason
<anarsoul> but there's no dedicated unit for it in Utgard
<raster> bbrezillon: ooh that...
<raster> sorry
<raster> skipped that
<raster> was going over scrollback
<raster> manualyl did that
<raster> lets see
<raster> hmm no
<bbrezillon> raster: can you be more specific about the damage rect mismatch?
<raster> doesnt help
<raster> ok
<raster> take a look at this
<raster> i'll explain
<bbrezillon> is it bigger? smaller? completely differetn?
<raster> so the first few frames its all right
<raster> setting update region == what panfrsot draw wallpaper thinks it has to do
<raster> the samage area is the whole buffer
<raster> then some smaller rects come through the pipeline
<bbrezillon> can you share the diff?
<raster> on screen u see a mouse cursor appear
<raster> and a cursor is blinking
<raster> also the scrollbar appears
<raster> thus those 3 regions as thsoe went from not there to visible etc.
<raster> then after that the 8x24 is just the cursor blinking
<raster> so ok - the batch of 3 regions ends up with the damage rect ebing everything
<raster> odd that its that pessimistic... but ok
<raster> but the frame after that... its wrong
<raster> its the last region only from the frame with 3 regions
<raster> not THIS frame which is 8x24 etc.
<raster> so what we're pushing in via api is not matching what panfrost is thinking it should be internally frame by frame
<raster> well that frame there is a hiccup and is a sign of some issue
<raster> anyway
<bbrezillon> raster: again, it's hard to debug without looking at the code changes (those adding traces)
<raster> let me undo my reset dmg changes and share
<raster> sure
<raster> yup
<raster> the only trace IN mesa is --panfrost
<raster> the rest are from higher up
<raster> the EEE:
<bbrezillon> you should also print traces at the partial_update() level (dumping all rects) to make sure they match what the app expects
<raster> its debug in the code that calls egl/gles
<raster> that is indeed a good thing to do
<raster> tho my printfs like REGION[x] are like in the code right above the egl call
<raster> so i am pretty sure its not being messed up on the way in within the calling code
<raster> not sure my 1 line of debug is useful to you though :)
<bbrezillon> raster: indeed, I need more :)
<bbrezillon> first thing to do, dump the rects past to panfrost_set_damage_region()
<bbrezillon> *passed
<bbrezillon> and compare them to the REGION[x] traces
chewitt has joined #panfrost
<bbrezillon> I meant panfrost_resource_set_damage_region()
<raster> so happy to see someone else lazy enough to use x, y, w, h like me
<raster> and not width, height :)
<raster> werll regions match on the way in
<raster> panfrost_resource_set_damage_region()
<raster> wait a sec....
<raster> i smell badnesses
<raster> this isnt inverse
<raster> its a bounding box
<raster> which is the INVERSE of what you want
<raster> so hmm 1 line high display. i provide 2 boxes
<raster> | [1] [2 ] |
<raster> if u take a bounding (min/max bounds as i read)
<raster> u'll create
<raster> | [bbox ] |
<raster> right?
<raster> but i as the caller have NO intention of updating the area BETWEEN [1] and [2]
<raster> because its not in my update rects....
<bbrezillon> there's 2 different things
<bbrezillon> the damage extent, and the biggest damage box
<bbrezillon> damage extent is used to restrict the rendering area
<raster> but the comments at least in panfrost_draw_wallpaper() tell me that you're going wallpaper boxes 1, 2, 3, 4 surrounding the damage rect
<bbrezillon> the biggest damage rect, yes
<bbrezillon> not the damage extent
<raster> hmmm though damage extent is wrong
<raster> oh wait sorry
<raster> if its a bounds it isnt never mind
<raster> i have something at 0,0
<raster> actually no wait...
<raster> it is wrong as that should be the extents a frame earlier
<raster> its like its 1 frame out of sync
<bbrezillon> then it's likely the problem reported by daniels
<raster> what is submitted via panfrost_resource_set_damage_region doesnt match then the rects we get in panfrost_draw_wallpaper
<raster> my debug definitely seems to indicate that its an off-by-1 in time
<bbrezillon> can you paste the dump?
<raster> let me add some more for you and get u a patch :)
<TheCycoTWO> weston is failing to start on the latest mesa master - core dump
<daniels> TheCycoTWO: which platform, and can you please give a backtrace?
<daniels> if it's line 909 of kms.c, revert to 7.0.0 and it'll be fixed tomorrow
<TheCycoTWO> kevin (rk3399). I don't have symbols in my build - guess I should change that. It's calling munmap_chunk
<alyssa> My beautiful scheduler algorithm is becoming a lot less beautiful the more non-SSA SIMD quirks I have to deal with :c
<raster> bbrezillon: just adding soem debug in getting buffer age and swap buffers as those are the important "clamping pieces" of the frame draw
<alyssa> Can reproduce Weston crash
<alyssa> bbrezillon: ^^
<raster> bbrezillon: https://pastebin.com/iQBnfxpC
<raster> sorry didnt get the buf age+ swap
<raster> looking
<raster> quick patch so far
<bbrezillon> alyssa: one of my patches?
<bbrezillon> weird that it passed CI?
<raster> but u will see that the input regions if slightly "exotic" dont match the regions decided on later in panfrost_draw_wallpaper
<alyssa> bbrezillon: 5882e0def97a47aff050f5a3f412b97a7f440e27
<bbrezillon> alyssa: is CI working?
* alyssa shrugs
<alyssa> Should I revert the patch?
<bbrezillon> yes please
<bbrezillon> actually, I can do it
<raster> bbrezillon: oh noes!
<raster> damage_extent->minx = 0xffff;
<raster> damage_extent->miny = 0xffff;
<raster> what will you do when we have backbuffers > 64k in size! :)
<bbrezillon> raster: I think the scissor state is also using u16
<raster> it probably is. was just joking :)
<bbrezillon> alyssa: just let me know if you want me to do the revert
<raster> just am reading code with my "looking for bugs" glasses on
<alyssa> bbrezillon: Yes, please.
<alyssa> (Either fix it or revert.)
stikonas has joined #panfrost
<bbrezillon> alyssa: I'll revert for now
<raster> i wonder if the panfrost_resource is even the same one
<raster> nope. it isn't
<bbrezillon> alyssa, TheCycoTWO: done
<TheCycoTWO> \o/
<bbrezillon> sorry for the mess
<raster> panfrost isnt even getting the same resource from the same texture
<raster> oh waint
<raster> no
<raster> it is
<alyssa> Okay, bite size task -- let's schedule without any of the register pressure estimation bits (no S-U)
<raster> same ptr anyway
<raster> but a different rsrc
<raster> oh not wait
<raster> sorry mixed up frames
<raster> yeah
<raster> pipe resource changes
<raster> bbrezillon: i wonder if.... somehow the update regions are being stored on an fbo we have bound in context instead of the left backbuffer?
adjtm_ has quit [Ping timeout: 245 seconds]
chewitt has quit [Read error: Connection reset by peer]
chewitt has joined #panfrost
<raster> yeah
<raster> found that already
<raster> and that resource != the one found in panfrost_draw_wallpaper
<raster> for now i don't know why (just don't know mesa code well enough to just knwo where to look)
<raster> but i'm looking about
<raster> i just printf'd the ptr for that and it differs
<raster> thus whyt he rects differ
<raster> ctx->pipe_framebuffer.cbufs[0] <- is my current "culprit" i'm looking into
<bbrezillon> raster: you might want to look at panfrost_set_framebuffer_state()
<raster> hmmm
<bbrezillon> you might be able to track when new FBs are bound
<raster> that was just what i was trying to do
<raster> i was beginning to suspect that the fb is bound later than expected
<raster> why - don't know
<bbrezillon> and we indeed execute the WP job on the currently bound FB
<raster> but the current bound fb->texture != the dri left backbuffer->texture
<raster> well not at the time the regions are set vs when the buffer is swapped
<bbrezillon> yes, maybe we shouldn't use this FB
<bbrezillon> let me check
<raster> the next frame when we start adding regions its the same fb as in the previous swap
<raster> i am not sure my userspace code is wrong as reading the specs quickly this only applies to backbuffer(s)
<raster> not fbo's etc.
<raster> well it keeps talking about backbuffers
<raster> (any postable surface)
<bbrezillon> can you try with that => http://code.bulix.org/66sy81-849758
<raster> some typo fied
<raster> yeah
<raster> job->batch
<raster> :)
<raster> still problems
<raster> didnt fix it
<bbrezillon> hm, that's really weird
<raster> it changed which buffers are "Wrong"
<bbrezillon> the res pointers still don't match?
<raster> yup
<raster> still not
<raster> so u can see the buffer age query
<raster> then submit a bunch of regions with pres=0xaaaaf2979fb0
<raster> then.... stuff... (rendering)
<raster> then swap and in that ... pres=[0xaaaaf23efd60]
<raster> not a match
<raster> and of course thus rects dont match etc.
<raster> those master clip printfs mean we're going ot set a scissor clip of at least that OR more restricted if we have to
adjtm_ has joined #panfrost
<bbrezillon> raster: can you add traces in panfrost_set_framebuffer_state()
<raster> sec
<bbrezillon> ideally with "%s:%i", __func__, __LINE__
<raster> ga
<raster> ok
mps has joined #panfrost
<raster> panfrost_get_job_for_fbo is called a lot :)
<alyssa> This is true.
<raster> shall look for gold in less noisy functions :)
<raster> bbrezillon: so yup
<raster> it'scalled just after we sety our first master clip
<raster> scissor clip
<raster> lets see if its the wp batch
<bbrezillon> did you print the new/old resource addr?
<raster> not yet
<raster> its not the wp batch. ok
<alyssa> Who knew that rewriting history would be so hard
<alyssa> Anyway, I'm now able to traverse blocks backwards by source via the worklist so
<alyssa> that was like 1% of the work
<bbrezillon> raster: can you paste the new dump?
<mps> are there any guide for newbie to run panfrost on samsung chromebook one plus with T860 gpu
<alyssa> What distribution?
<mps> I have kernel 5.2.10 with panfrost enabled
<alyssa> OK
<mps> alyssa: Alpine linux
<alyssa> Not sure if anyone has tried on Alpine
<alyssa> Er that's outdated
<mps> I built mesa with panfrost enabled and I have /usr/lib/xorg/modules/dri/panfrost_dri.so
<alyssa> Don't use the linked tree; your 5.2 kernel with panfrost enabled is perfect.
<alyssa> Alright.
<alyssa> What's the issue, then? It sounds like you should be panfrosting all over the place! :p
<mps> from Xorg.0.log 'falling back to /sys/devices/platform/display-subsystem/drm/card0'
<alyssa> Try with weston first.
<mps> no, I don't use weston
<alyssa> Please try.
<mps> never tried
<mps> uhm, ok will do
<mps> have no idea how to use it, TBH
<mps> but will look
<raster> bbrezillon: just extracting the surf->texture in an ugly way
<raster> so yes
<raster> this "overwrites" the current fb state with the new one
<bbrezillon> and I guess it triggers a flush
<raster> ok
<raster> one of them is in drawarrays
<raster> the other in swapbuffers
<raster> i'm grabbing backtraces
<bbrezillon> one of these set_fb_state() is caused by the u_blitter call done in panfrost_blit_wallpaper()
<bbrezillon> but this one should not trigger a flush
<raster> actually the first one in drawarrays screws it up as u can see the pres changed at that drawarrays
<raster> so the first bt is the problem
<bbrezillon> when is set_damage_region() called?
<raster> before the drawarrays, after getting of buffer age
<raster> EEE: BUFFER AGE: 2
<raster> EEE: REGION[0] SET 72 104 8x24
<raster> --panfrost: [pres=0xaaaaab0073d0] in -> region[0] 72 104 8x24
<raster> those tell me that :)
<raster> sot he blit code here is doing the right thing
<bbrezillon> and the draw arrays is targeting this buffer, right?
yann has joined #panfrost
<raster> yup
<raster> well ok wait
<raster> the drawarrays COULD tasrget an fbo
<raster> b ut i doubt it in these circumstances
<raster> but i can check what we bindframebuffer to
<bbrezillon> yep
<raster> but it shouldnt matter what fb we have bound or not, region stuff should always apply to the backbuffer here
<raster> we just use fbo's for offscren rendering
<raster> not other buffers
<raster> yup
<raster> we bindefb to 0 at the start
<raster> and we dont ever change it ever again
<raster> double chedked
<raster> double checked
<raster> no other calls
<bbrezillon> raster: I think damage region is applied to the proper resource
<raster> i threw in printfs in the only others (they are used for special circumstances and not this basic stuff)
<raster> hmm
<raster> why does drawarrays mess it up?
<raster> or... is drawarrays doing the right thing?
<bbrezillon> it's the resource we get when doing the wallpaper blit that's wrong
<raster> and when we set region we should "push along some new cbuf fb's" ?
<raster> hmmm
<raster> is it?
<raster> i am not so sure
<raster> we attach our regions to a panres
<raster> but drawarrays uses a different panres
<raster> that is right?
<raster> (forget the wallpaper thing for now) ?
<bbrezillon> depends which FB the draw arrays is targeting I guess
<raster> well in this case there is only one "presentable" one
<raster> the backbuffer
<bbrezillon> so, we have should have setDamage(backFB, ...), drawArrays(backFB), swapBuffers()
<raster> yup
<alyssa> ../src/util/u_dynarray.h:171:59: error: invalid initializer
<alyssa> #define util_dynarray_append(buf, type, v) do {type __v = (v); memcpy(util_dynarray_grow_bytes((buf), 1, sizeof(type)), &__v, sizeof(type));} while(0)
<alyssa> Oy
* alyssa was missing an asterisk
<alyssa> Okay... I have instructions emitted in the right order, at least.
<bbrezillon> raster: can you print the old and new pres in set_fb_state()?
<raster> ...
<mmind00> alyssa: found my issue ... "someone" forgot to add my user to the render usergroup
<raster> let me not segv
<raster> bbrezillon: as expected
<raster> --panfrost: [pres=0xaaaad1852f70] in -> region[2] 952 528 40x40
<raster> EEE: MASTER CLIP 0 0 32x32
<raster> --panfrost_set_framebuffer_state [pres=0xaaaad1852f70] -> [pres=0xaaaad12c92b0]
<raster> ..
<raster> --panfrost: pres=[0xaaaad12c92b0], rsrc: 0 0 1920x1080 | batch: 0 0 1920x1080 | damage: 0 0 1920x1080
<raster> set fb state "loses" our rects
<raster> at least by the time we get to a swapbuffer its not the same panres
<bbrezillon> and the swap happens before the first trace?
<raster> and thus not the same rects
<bbrezillon> can you print the old -> new backbuffer res pointer in the swapBuffer call?
<raster> the ones that do the wallpaper batchie
<raster> i.e
<raster> if (ctx->wallpaper_batch) {
<raster> that if
<raster> dont change the fb state
<raster> well same texture to same texture
<raster> bbrezillon: should we continue tomorrow?
<alyssa> Argh, I gotta do a whole bunch more on RA now... just when I thought I was making forward progress... well I still am but
<raster> RA?
<alyssa> register allocation
<raster> aaaah
<raster> why bother?
<alyssa> Huh?
<raster> just use 1 register and swap in and out
<raster> al good
<raster> all good
* alyssa blinks
<raster> :)
<raster> ok. 2. luxury. src and dest operands
<raster> :)
<raster> no one ever needs more than 2 registers!
<raster> :)
* raster mumbles something about 640k...
<alyssa> 6502 had Y in addition to A and X
<alyssa> was a real luxury/
<raster> see? luxury!
<raster> superfluous registers
<raster> ok
<raster> i really do need to go
<raster> bbrezillon: we'll catch up tomorrow
<raster> i need dinner
<raster> already 9:20pm
<raster> time to roll -> my stomach is telling me :)
<raster> nite!
raster has quit [Remote host closed the connection]
* mmind00 was a total rebel and removed the blacklist for chrome from panfrost :-D
* mmind00 was a total rebel and removed the blacklist for chrome from panfrost :-D
<mmind00> whops ... wrong keyboard
chewitt has quit [Read error: Connection reset by peer]
chewitt has joined #panfrost
chewitt has quit [Quit: Adios!]
<alyssa> With out-of-order scheduling, most of glmark is working
<alyssa> Discards and csels are broken, so I guess fixing that is next.
<anarsoul> alyssa: don't forget about nir regs :)
<anarsoul> (or rather about write after read deps for nir regs)
<alyssa> anarsoul: What about thrm?
<anarsoul> you probably have to add them. Otherwise your out of ordering scheduler can reschedule something like: r0 = r1; r1 = r1 + 1;
<alyssa> I think I handle that
<anarsoul> cool
<alyssa> Gah who knows rewriting so much code would break so much
<alyssa> Accomplishments for the day:
<alyssa> - Broke a bunch of shaders
<alyssa> - Caused performance to drop by 4x
<anarsoul> :(
<alyssa> Sounds like a good to me!
<xdarklight> the good thing about this: if someone says that you "didn't do anything today" then you have numbers to prove them wrong
<anarsoul> (everything is fine meme here)
<alyssa> xdarklight: Yup!
megi has joined #panfrost
stikonas has quit [Remote host closed the connection]
<bbrezillon> daniels: are we sure drawable->textures[ST_ATTACHMENT_BACK_LEFT] is up-to-date when dri2_set_damage_region() is called?
raster has joined #panfrost
raster has quit [Remote host closed the connection]
mps has left #panfrost [#panfrost]
raster has joined #panfrost
<bbrezillon> raster: you might want to try with http://code.bulix.org/jcn8f9-849883
<raster> bbrezillon: i'll try that tomorrow. dont have my panfrosty board accessible now
<raster> bbrezillon: but this seems odd that you have to dig into common infra here that drivers share....
<bbrezillon> raster: the generic partial_update() have been added for panfrost
<bbrezillon> *generic partial_update() bits
<raster> oooh
<bbrezillon> so it's not been heavily tested
<raster> i didnt look
<raster> got it
<raster> i kind of dismissed that code as being "heavily/well tested and thus the issue must be inside panfrost"
<raster> well then thanks for that background... very useful :)
<raster> efl may have been helpful in finding a bug... let's see tomorrow :)
<alyssa> Well, I have csel working.
<alyssa> It breaks a ton of other stuff apparently
<alyssa> Oh, nah
<alyssa> grmb
raster has quit [Remote host closed the connection]
<alyssa> Anyway, got csel working correctly.
<alyssa> Next up, branching
<alyssa> Glump
tlwoerner has quit [Read error: Connection reset by peer]
tlwoerner has joined #panfrost