detached 94546f0

chore(deps): pin cef2gtk dmabuf churn

commit
94546f0ee3810084d5588fabd7481b1aabb9136a
author
brice · · 2026-07-14 16:10 UTC
parent
c5ad8c0
signature
GPG VerifiedCD88F9E564E0102646FB6077A1A07C7C7C3E349D · arch-gpg Verified for the committer email
6 files · +165 -127
M go.mod +1 -1
@@ -7,7 +7,7 @@ require (
77 github.com/andybalholm/brotli v1.2.2
88 github.com/bnema/purego v0.11.0-bnema.4
99 github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e
10- github.com/bnema/purego-cef2gtk v0.8.4
10+ github.com/bnema/purego-cef2gtk v0.8.4-0.20260714160309-bbd397409ebe
1111 github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a
1212 github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c
1313 github.com/bnema/puregotk v0.7.0
@@ -7,7 +7,7 @@ require (
7 github.com/andybalholm/brotli v1.2.27 github.com/andybalholm/brotli v1.2.2
8 github.com/bnema/purego v0.11.0-bnema.48 github.com/bnema/purego v0.11.0-bnema.4
9 github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e9 github.com/bnema/purego-cef v0.13.4-0.20260714140305-f0b7414af67e
10- github.com/bnema/purego-cef2gtk v0.8.410+ github.com/bnema/purego-cef2gtk v0.8.4-0.20260714160309-bbd397409ebe
11 github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a11 github.com/bnema/purego-pipewire v0.1.5-0.20260714124450-6504b9cdf02a
12 github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c12 github.com/bnema/purego-sqlite v0.1.4-0.20260714131321-3614fe683b9c
13 github.com/bnema/puregotk v0.7.013 github.com/bnema/puregotk v0.7.0
M go.sum +2 -0 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/cefadapter/accelerated_paint.go +34 -37 generated file: collapsed
M vendor/github.com/bnema/purego-cef2gtk/internal/dmabuf/frame.go +38 -19
@@ -59,6 +59,20 @@ type BorrowedFrame struct {
5959 Planes []Plane
6060 }
6161
62+// SinglePlaneFrame is the allocation-free representation for the only DMABUF
63+// layout currently supported by the GDK renderer. Its FD remains owned by CEF.
64+type SinglePlaneFrame struct {
65+ CodedSize Size
66+
67+ VisibleRect Rect
68+ ContentRect Rect
69+ SourceSize Size
70+
71+ Format FourCC
72+ Modifier uint64
73+ Plane Plane
74+}
75+
6276 // checkedMulUint64 returns a*b and a boolean indicating whether the result is valid
6377 // (false on overflow). A zero result is always valid.
6478 func checkedMulUint64(a, b uint64) (uint64, bool) {
@@ -80,16 +94,25 @@ func checkedAddUint64(a, b uint64) (uint64, bool) {
8094 // plane, one of four RGB formats, positive coded size, non-negative fd, non-zero stride,
8195 // and overflow-safe plane extent bounds.
8296 func (f BorrowedFrame) Validate() error {
83- if !f.CodedSize.Valid() {
84- return fmt.Errorf("%w: %dx%d", ErrInvalidCodedSize, f.CodedSize.Width, f.CodedSize.Height)
85- }
86- if !f.Format.Supported() {
87- return fmt.Errorf("%w: %s", ErrUnsupportedFormat, f.Format)
88- }
8997 if len(f.Planes) != supportedPlaneCount {
9098 return fmt.Errorf("%w: got %d, want %d", ErrUnsupportedPlanes, len(f.Planes), supportedPlaneCount)
9199 }
92- plane := f.Planes[0]
100+ return validateSinglePlaneFrame(f.CodedSize, f.Format, f.Planes[0])
101+}
102+
103+// Validate applies the same support and bounds checks as BorrowedFrame.Validate
104+// without requiring a heap-backed plane slice.
105+func (f SinglePlaneFrame) Validate() error {
106+ return validateSinglePlaneFrame(f.CodedSize, f.Format, f.Plane)
107+}
108+
109+func validateSinglePlaneFrame(codedSize Size, format FourCC, plane Plane) error {
110+ if !codedSize.Valid() {
111+ return fmt.Errorf("%w: %dx%d", ErrInvalidCodedSize, codedSize.Width, codedSize.Height)
112+ }
113+ if !format.Supported() {
114+ return fmt.Errorf("%w: %s", ErrUnsupportedFormat, format)
115+ }
93116 if plane.FD < 0 {
94117 return fmt.Errorf("%w: %d", ErrInvalidPlaneFD, plane.FD)
95118 }
@@ -97,29 +120,25 @@ func (f BorrowedFrame) Validate() error {
97120 return fmt.Errorf("%w: %d", ErrInvalidStride, plane.Stride)
98121 }
99122
100- // Stride must be wide enough for one coded row at the format's bpp.
101- bpp := uint64(f.Format.BytesPerPixel())
102- minStride, ok := checkedMulUint64(uint64(f.CodedSize.Width), bpp)
123+ bpp := uint64(format.BytesPerPixel())
124+ minStride, ok := checkedMulUint64(uint64(codedSize.Width), bpp)
103125 if !ok {
104- return fmt.Errorf("%w: width %d * %d bytes-per-pixel overflows uint64", ErrPlaneExtentOverflow, f.CodedSize.Width, bpp)
126+ return fmt.Errorf("%w: width %d * %d bytes-per-pixel overflows uint64", ErrPlaneExtentOverflow, codedSize.Width, bpp)
105127 }
106128 if uint64(plane.Stride) < minStride {
107- return fmt.Errorf("%w: stride %d < minimum %d (width %d * %d bytes-per-pixel)", ErrInvalidStride, plane.Stride, minStride, f.CodedSize.Width, bpp)
129+ return fmt.Errorf("%w: stride %d < minimum %d (width %d * %d bytes-per-pixel)", ErrInvalidStride, plane.Stride, minStride, codedSize.Width, bpp)
108130 }
109131
110- // Overflow-safe minimum buffer extent validation.
111- stride := uint64(plane.Stride)
112- height := uint64(f.CodedSize.Height)
113- rowBytes, ok := checkedMulUint64(stride, height)
132+ rowBytes, ok := checkedMulUint64(uint64(plane.Stride), uint64(codedSize.Height))
114133 if !ok {
115- return fmt.Errorf("%w: stride %d * coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Stride, f.CodedSize.Height)
134+ return fmt.Errorf("%w: stride %d * coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Stride, codedSize.Height)
116135 }
117136 requiredExtent, ok := checkedAddUint64(plane.Offset, rowBytes)
118137 if !ok {
119- return fmt.Errorf("%w: offset %d + stride*coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Offset, rowBytes)
138+ return fmt.Errorf("%w: offset %d + stride*coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Offset, codedSize.Height)
120139 }
121140 if plane.Size > 0 && plane.Size < requiredExtent {
122- return fmt.Errorf("%w: plane size %d < required minimum extent %d (offset %d + stride %d * coded height %d)", ErrPlaneSizeTooSmall, plane.Size, requiredExtent, plane.Offset, plane.Stride, f.CodedSize.Height)
141+ return fmt.Errorf("%w: plane size %d < required minimum extent %d (offset %d + stride %d * coded height %d)", ErrPlaneSizeTooSmall, plane.Size, requiredExtent, plane.Offset, plane.Stride, codedSize.Height)
123142 }
124143 return nil
125144 }
@@ -59,6 +59,20 @@ type BorrowedFrame struct {
59 Planes []Plane59 Planes []Plane
60 }60 }
61 61
62+// SinglePlaneFrame is the allocation-free representation for the only DMABUF
63+// layout currently supported by the GDK renderer. Its FD remains owned by CEF.
64+type SinglePlaneFrame struct {
65+ CodedSize Size
66+
67+ VisibleRect Rect
68+ ContentRect Rect
69+ SourceSize Size
70+
71+ Format FourCC
72+ Modifier uint64
73+ Plane Plane
74+}
75+
62 // checkedMulUint64 returns a*b and a boolean indicating whether the result is valid76 // checkedMulUint64 returns a*b and a boolean indicating whether the result is valid
63 // (false on overflow). A zero result is always valid.77 // (false on overflow). A zero result is always valid.
64 func checkedMulUint64(a, b uint64) (uint64, bool) {78 func checkedMulUint64(a, b uint64) (uint64, bool) {
@@ -80,16 +94,25 @@ func checkedAddUint64(a, b uint64) (uint64, bool) {
80 // plane, one of four RGB formats, positive coded size, non-negative fd, non-zero stride,94 // plane, one of four RGB formats, positive coded size, non-negative fd, non-zero stride,
81 // and overflow-safe plane extent bounds.95 // and overflow-safe plane extent bounds.
82 func (f BorrowedFrame) Validate() error {96 func (f BorrowedFrame) Validate() error {
83- if !f.CodedSize.Valid() {
84- return fmt.Errorf("%w: %dx%d", ErrInvalidCodedSize, f.CodedSize.Width, f.CodedSize.Height)
85- }
86- if !f.Format.Supported() {
87- return fmt.Errorf("%w: %s", ErrUnsupportedFormat, f.Format)
88- }
89 if len(f.Planes) != supportedPlaneCount {97 if len(f.Planes) != supportedPlaneCount {
90 return fmt.Errorf("%w: got %d, want %d", ErrUnsupportedPlanes, len(f.Planes), supportedPlaneCount)98 return fmt.Errorf("%w: got %d, want %d", ErrUnsupportedPlanes, len(f.Planes), supportedPlaneCount)
91 }99 }
92- plane := f.Planes[0]100+ return validateSinglePlaneFrame(f.CodedSize, f.Format, f.Planes[0])
101+}
102+
103+// Validate applies the same support and bounds checks as BorrowedFrame.Validate
104+// without requiring a heap-backed plane slice.
105+func (f SinglePlaneFrame) Validate() error {
106+ return validateSinglePlaneFrame(f.CodedSize, f.Format, f.Plane)
107+}
108+
109+func validateSinglePlaneFrame(codedSize Size, format FourCC, plane Plane) error {
110+ if !codedSize.Valid() {
111+ return fmt.Errorf("%w: %dx%d", ErrInvalidCodedSize, codedSize.Width, codedSize.Height)
112+ }
113+ if !format.Supported() {
114+ return fmt.Errorf("%w: %s", ErrUnsupportedFormat, format)
115+ }
93 if plane.FD < 0 {116 if plane.FD < 0 {
94 return fmt.Errorf("%w: %d", ErrInvalidPlaneFD, plane.FD)117 return fmt.Errorf("%w: %d", ErrInvalidPlaneFD, plane.FD)
95 }118 }
@@ -97,29 +120,25 @@ func (f BorrowedFrame) Validate() error {
97 return fmt.Errorf("%w: %d", ErrInvalidStride, plane.Stride)120 return fmt.Errorf("%w: %d", ErrInvalidStride, plane.Stride)
98 }121 }
99 122
100- // Stride must be wide enough for one coded row at the format's bpp.123+ bpp := uint64(format.BytesPerPixel())
101- bpp := uint64(f.Format.BytesPerPixel())124+ minStride, ok := checkedMulUint64(uint64(codedSize.Width), bpp)
102- minStride, ok := checkedMulUint64(uint64(f.CodedSize.Width), bpp)
103 if !ok {125 if !ok {
104- return fmt.Errorf("%w: width %d * %d bytes-per-pixel overflows uint64", ErrPlaneExtentOverflow, f.CodedSize.Width, bpp)126+ return fmt.Errorf("%w: width %d * %d bytes-per-pixel overflows uint64", ErrPlaneExtentOverflow, codedSize.Width, bpp)
105 }127 }
106 if uint64(plane.Stride) < minStride {128 if uint64(plane.Stride) < minStride {
107- return fmt.Errorf("%w: stride %d < minimum %d (width %d * %d bytes-per-pixel)", ErrInvalidStride, plane.Stride, minStride, f.CodedSize.Width, bpp)129+ return fmt.Errorf("%w: stride %d < minimum %d (width %d * %d bytes-per-pixel)", ErrInvalidStride, plane.Stride, minStride, codedSize.Width, bpp)
108 }130 }
109 131
110- // Overflow-safe minimum buffer extent validation.132+ rowBytes, ok := checkedMulUint64(uint64(plane.Stride), uint64(codedSize.Height))
111- stride := uint64(plane.Stride)
112- height := uint64(f.CodedSize.Height)
113- rowBytes, ok := checkedMulUint64(stride, height)
114 if !ok {133 if !ok {
115- return fmt.Errorf("%w: stride %d * coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Stride, f.CodedSize.Height)134+ return fmt.Errorf("%w: stride %d * coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Stride, codedSize.Height)
116 }135 }
117 requiredExtent, ok := checkedAddUint64(plane.Offset, rowBytes)136 requiredExtent, ok := checkedAddUint64(plane.Offset, rowBytes)
118 if !ok {137 if !ok {
119- return fmt.Errorf("%w: offset %d + stride*coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Offset, rowBytes)138+ return fmt.Errorf("%w: offset %d + stride*coded height %d overflows uint64", ErrPlaneExtentOverflow, plane.Offset, codedSize.Height)
120 }139 }
121 if plane.Size > 0 && plane.Size < requiredExtent {140 if plane.Size > 0 && plane.Size < requiredExtent {
122- return fmt.Errorf("%w: plane size %d < required minimum extent %d (offset %d + stride %d * coded height %d)", ErrPlaneSizeTooSmall, plane.Size, requiredExtent, plane.Offset, plane.Stride, f.CodedSize.Height)141+ return fmt.Errorf("%w: plane size %d < required minimum extent %d (offset %d + stride %d * coded height %d)", ErrPlaneSizeTooSmall, plane.Size, requiredExtent, plane.Offset, plane.Stride, codedSize.Height)
123 }142 }
124 return nil143 return nil
125 }144 }
M vendor/github.com/bnema/purego-cef2gtk/internal/gtkgdk/renderer.go +89 -69 generated file: collapsed
M vendor/modules.txt +1 -1 generated file: collapsed

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close