Codebergdnkl
foot
master
1#pragma once
3#include <stdbool.h>
4#include <stddef.h>
5#include <sys/types.h>
7#include <pixman.h>
8#include <wayland-client.h>
10#include <tllist.h>
12#include "config.h"
13#include "wayland.h"
15struct damage;
17struct buffer {
18 int width;
19 int height;
20 int stride;
22 void *data;
24 struct wl_buffer *wl_buf;
25 pixman_image_t **pix;
26 size_t pix_instances;
28 unsigned age;
30 /*
31 * First item in the array is used to track frame-to-frame
32 * damage. This is used when re-applying damage from the last
33 * frame, when the compositor doesn't release buffers immediately
34 * (forcing us to double buffer)
35 *
36 * The remaining items are used to track surface damage. Each
37 * worker thread adds its own cell damage to "its" region. When
38 * the frame is done, all damage is converted to a single region,
39 * which is then used in calls to wl_surface_damage_buffer().
40 */
41 pixman_region32_t *dirty;
42};
44void shm_fini(void);
46/* TODO: combine into shm_init() */
47void shm_set_max_pool_size(off_t max_pool_size);
48void shm_set_min_stride_alignment(size_t min_stride_alignment);
50struct buffer_chain;
51struct buffer_chain *shm_chain_new(
52 struct wayland *wayl, bool scrollable, size_t pix_instances,
53 enum shm_bit_depth desired_bit_depth,
54 void (*release_cb)(struct buffer *buf, void *data), void *cb_data);
55void shm_chain_free(struct buffer_chain *chain);
57enum shm_bit_depth shm_chain_bit_depth(const struct buffer_chain *chain);
59/*
60 * Returns a single buffer.
61 *
62 * May returned a cached buffer. If so, the buffer's age indicates how
63 * many shm_get_buffer() calls have been made for the same
64 * width/height while the buffer was still busy.
65 *
66 * A newly allocated buffer has an age of 1234.
67 */
68struct buffer *shm_get_buffer(struct buffer_chain *chain, int width, int height);
69/*
70 * Returns many buffers, described by 'info', all sharing the same SHM
71 * buffer pool.
72 *
73 * Never returns cached buffers. However, the newly created buffers
74 * are all inserted into the regular buffer cache, and are treated
75 * just like buffers created by shm_get_buffer().
76 *
77 * This function is useful when allocating many small buffers, with
78 * (roughly) the same life time.
79 *
80 * Buffers are tagged for immediate purging, and will be destroyed as
81 * soon as the compositor releases them.
82 */
83void shm_get_many(
84 struct buffer_chain *chain, size_t count,
85 int widths[static count], int heights[static count],
86 struct buffer *bufs[static count]);
88void shm_did_not_use_buf(struct buffer *buf);
90bool shm_can_scroll(const struct buffer *buf);
91bool shm_scroll(struct buffer *buf, int rows,
92 int top_margin, int top_keep_rows,
93 int bottom_margin, int bottom_keep_rows);
95void shm_addref(struct buffer *buf);
96void shm_unref(struct buffer *buf);
98void shm_purge(struct buffer_chain *chain);
Diagnostics6 git calls · 475 ms
CallStatusSizeTime0475 ms
discover200178 B3 ms
git.upload-pack discover http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=3 git.response.bytes=178 git.server.agent=git/2.56.1-Linux git.server.object_format=sha1 git.server.caps=agent ls-refs fetch server-option object-format git.server.fetch=shallow wait-for-done filter git.protocol.version=2 git.pkt.frames=9 git.pkt.data=7 git.pkt.flush=2 git.pkt.delim=0 git.pkt.bytes=178 git.pkt.payload.max=35
ls-refs20010 KiB454 ms
git.upload-pack ls-refs http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=ls-refs git.upstream.dur_ms=372 git.response.bytes=10322 git.response.cache=EXPIRED git.response.duration_ms=454 git.protocol.version=2 git.pkt.frames=108 git.pkt.data=107 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=10322 git.pkt.payload.max=106 git.ls_refs.count=107 git.ls_refs.head=refs/heads/master
fetchcombine:blob:none+tree:2 · deepen 12008.6 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=8830 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=combine:blob:none+tree:2 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=1 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=8830 git.pkt.payload.max=8730 git.sideband.band1.bytes=8730 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=14 git.pack.bytes=8730 git.fetch.wide.objects=14 git.fetch.wide.extra_bytes=9909 git.fetch.wide.blobs=0
fetchtree:0 · deepen 12001.1 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=1154 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=1 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=1154 git.pkt.payload.max=1054 git.sideband.band1.bytes=1054 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=1 git.pack.bytes=1054 git.pack.trailer=f9afe4130b8e969286b1fa36663bbb8999db09eaOpen pack map
fetchtree:0 · deepen 102009.3 KiB · hit2 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=2 git.response.bytes=9489 git.response.cache=HIT git.response.duration_ms=2 git.fetch.filter=tree:0 git.fetch.wants=c0d2c3e95d74cb60526ff28aec9f34ee3df545e0 git.fetch.haves.count=0 git.fetch.deepen=10 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=7 git.pkt.data=5 git.pkt.flush=1 git.pkt.delim=1 git.pkt.bytes=9489 git.pkt.payload.max=9389 git.sideband.band1.bytes=9389 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0 git.pack.objects=10 git.pack.bytes=9389 git.pack.ofs_delta=0 git.pack.ref_delta=0 git.pack.chain.max=0 git.pack.trailer=de930681b6073ba5b599a0f956bfbd114762ad5a git.pack.full=10Open pack map
fetch2001.2 KiB · hit19 ms
git.upload-pack fetch http.response.status_code=200 git.upstream.cf_ray=- git.upstream.phase=fetch git.upstream.dur_ms=19 git.response.bytes=1211 git.response.cache=HIT git.response.duration_ms=19 git.fetch.wants=c58a8531e768d3eef332691184b36a46377743ad git.fetch.haves.count=0 git.fetch.deepen=0 git.fetch.thin_pack=false git.fetch.ofs_delta=true git.protocol.version=2 git.pkt.frames=4 git.pkt.data=3 git.pkt.flush=1 git.pkt.delim=0 git.pkt.bytes=1211 git.pkt.payload.max=1184 git.sideband.band1.bytes=1184 git.sideband.band2.bytes=0 git.sideband.band3.bytes=0
Each row is one HTTP round trip ply made to the git server for this page, on one timeline. discover asks what the server speaks, ls-refs lists branch tips, fetch brings objects by id. A hit was served by Workers Cache. Tap a row for its wire details.
- Remote
- https://codeberg.org/dnkl/foot
- Ref
- refs/heads/master
- Commit
- c0d2c3e95d74cb60526ff28aec9f34ee3df545e0
- cf-ray
- a5e2c0f87ac889da
- Request
- d460d0de…
- Protocol
- v2 · sha1
- Agent
- git/2.56.1-Linux
- Filter
- advertised
- Fetch
- shallow wait-for-done filter
- Capabilities
- agent ls-refs fetch server-option object-format