#
#asahi-dev · 2023-08-04 08:45
marcan System Total PSTR 0.2 W flt
#asahi-dev · 2023-08-04 08:45
marcan Heatpipe PHPC 0.5 W flt
#asahi-dev · 2023-08-04 08:45
marcan Battery PPBR 1.6 W flt
#asahi-dev · 2023-08-04 08:44
chadmedhmmm ok i think we're a bit higher than that with EAS at the desktop so there might be some gains left on the table in the cpus
#asahi-dev · 2023-08-04 08:43
marcan0.5
#asahi-dev · 2023-08-04 08:43
chadmedwhat does PHPC say
#asahi-dev · 2023-08-04 08:43
marcanPPBR (battery power) is higher but I think that might be a lie, since it doesn't track PSTR well at all
#asahi-dev · 2023-08-04 08:42
marcan(at which point I'd be very happy telling people they don't need real s2ram)
#asahi-dev · 2023-08-04 08:42
marcanthat would be 250 hours of s2idle best case
#asahi-dev · 2023-08-04 08:42
marcanso that's our target for figuring out runtime PM and whatever is eating power
#asahi-dev · 2023-08-04 08:41
marcanunrelated note: finally got around to poking SMC from macOS. on an M1 air in screen-off idle, with SSH over WiFi active, PSTR claims 0.2-0.4W
#asahi-dev · 2023-08-04 08:17
eilnmarcan: give me a few minutes I'll push the branch
#asahi-dev · 2023-08-04 08:09
marcanyou don't actually block in the driver proper, you just add buffers to isp->buffers until there are enough to submit, and only submit at that point
#asahi-dev · 2023-08-04 08:09
marcanwhere everything in either of the second two lists is also necessarily in queued_list
#asahi-dev · 2023-08-04 08:08
marcanqueued_list is "buffers not owned by userspace", isp->buffers is "buffers owned by the device", and done_list is "buffers waiting to be dequeued by userspace"
#asahi-dev · 2023-08-04 08:08
marcan(as well as remove from the main queued list)
#asahi-dev · 2023-08-04 08:07
marcanbasically every time you call vb2_buffer_done those get put into a list, and dqbuf will pull from that list
#asahi-dev · 2023-08-04 08:06
marcaneiln: my understanding of the queueing is this: https://gist.github.com/marcan/2ef2c3ecbf0aebf1459c1ce2adc960d2
#asahi-dev · 2023-08-04 08:01
_jannau__if if user space needs more buffers, it needs to request buffers. we can add 1 or 2 to that number
#asahi-dev · 2023-08-04 07:58
_jannau__if the driver needs at least 2 frames for processing the queue size has to be at least for. the driver can enforce that at request_buffers time
#asahi-dev · 2023-08-04 07:57
_jannau__in a typical display scenario 3 buffers are needed. user space needs 1 for display and enqueues it after next was dequeued and is display. the driver has in the mean time 1 frame for processing
#asahi-dev · 2023-08-04 07:54
_jannau__user space dequeues buffers as fast as it needs to and holdson to as many buffers as it needs
#asahi-dev · 2023-08-04 07:52
_jannau__I don't think there is a problem from my experience writting and reading v4l2 uuser space code
#asahi-dev · 2023-08-04 07:45
marcanlet me write this up in a gist
#asahi-dev · 2023-08-04 07:45
eilnthe buf being buf = list_first_entry_or_null(&video->buffers, struct aspeed_video_buffer, link);
#asahi-dev · 2023-08-04 07:45
eilnin the irq I'd do vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_DONE); list_del(&buf->link); for both buffers
#asahi-dev · 2023-08-04 07:44
eilnthat private list is the one I operate on
#asahi-dev · 2023-08-04 07:43
eilnthe ioctl behind buf_queue is list_add_tail(&buf->link, &isp->buffers);
#asahi-dev · 2023-08-04 07:42
marcanq is vb2_queue
#asahi-dev · 2023-08-04 07:42
eilntypo, ignore
#asahi-dev · 2023-08-04 07:42
marcanwhat's p?
#asahi-dev · 2023-08-04 07:41
eilnwhich they can't if I'm blocking on the "one empty buffer in the queue" part
#asahi-dev · 2023-08-04 07:41
eilnI only have one queue, p->queued list. I don't track done bufs. the user has to re-queue it into the queued list
#asahi-dev · 2023-08-04 07:39
marcanqbuf puts stuff into queued_list, and dqbuf grabs stuff from done_list
#asahi-dev · 2023-08-04 07:39
marcanI think I'm right, one list is q->queued_list and the other q->done_list?
#asahi-dev · 2023-08-04 07:37
marcanis that wrong?
#asahi-dev · 2023-08-04 07:37
marcanlike the way I see this there are two queues, one of empty buffers and one of processed buffers, and buffers move from empty to processed under driver control, and from processed to empty under userspace control
#asahi-dev · 2023-08-04 07:36
marcan*mark 2 done
#asahi-dev · 2023-08-04 07:36
marcan... empty buffer in the queue. the next dequeue it grabs another processed buffer, since you still have 2 of those.
#asahi-dev · 2023-08-04 07:36
marcanreqbufs is 3, you send 2 off to ISP. ISP comes back with that data, you mark 2 code. there are now 2 complete buffers in the queue and 1 empty buffer. user dequeues one of the complete buffers, and re-enqueues it. there are now 2 empty buffers in the queue, which you send off to ISP, and they come back. userspace dequeues one buffer from the processed list, and re-enqueues it. there is now 1 ...
#asahi-dev · 2023-08-04 07:35
marcanlet me rephrase your scenario, tell me where I'm confused
#asahi-dev · 2023-08-04 07:34
eilnempty buffers?
#asahi-dev · 2023-08-04 07:34
marcanbut it's not dequeuing empty buffers from the queue, it's dequeueing processed buffers, no?
#asahi-dev · 2023-08-04 07:34
eilnif i block
#asahi-dev · 2023-08-04 07:33
eilnbatch count
#asahi-dev · 2023-08-04 07:33
eilnsay the reqbufs count is 3. I'd mark two done, leaving me with 1 in the queue. but the user would typically only poll for one dequeue, and (logically) enqueue one more. there's now 2 in my queue, which I'd process both and send off. the user (again) dequeues one and enqueues another, leaving 1 in the queue. they'd hang on the next dequeue because we're not operating on the same
#asahi-dev · 2023-08-04 07:32
eilnuser initally requests all buffers with VIDIOC_REQBUFS. that count I can modify/gurantee. after that, when stream starts, the driver marks the processed buffers and kicks them out of the queue. then those can be delivered to userspace polling with VIDIOC_DQBUF. most processes would use alternating enqueue/dequeue, which for the ISP is NOT 1 but the batch count.
#asahi-dev · 2023-08-04 07:32
marcaneven if there are already buffers ready?
#asahi-dev · 2023-08-04 07:32
eilnmarcan: deadlock is the VIDIOC_DQBUF ioctl, which polls for one buf to be processed by the driver
#asahi-dev · 2023-08-04 07:31
marcaneiln: sorry if I'm completely misunderstanding the issue here, queueing shenanigans get hairy :(

plus ›