Skip to content

Commit f3c3365

Browse files
committed
Remove _MASK fields from generated code
1 parent f7d899c commit f3c3365

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

linuxpy/codegen/fb.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,21 @@
4242
{iocs_body}
4343
"""
4444

45+
46+
def no_mask(key, value):
47+
return not key.endswith("_MASK")
48+
49+
4550
# macros from #define statements
4651
MACRO_ENUMS = [
4752
CEnum("Type", "FB_TYPE_"),
48-
CEnum("Text", "FB_AUX_TEXT_"),
53+
CEnum("Text", "FB_AUX_TEXT_", filter=no_mask),
4954
CEnum("VGAPlanes", "FB_AUX_VGA_PLANES_"),
5055
CEnum("Visual", "FB_VISUAL_"),
5156
CEnum("Acceleration", "FB_ACCEL_"),
57+
CEnum("Activate", ["FB_ACTIVATE_", "FB_CHANGE_"], klass="IntFlag", filter=no_mask),
5258
CEnum("Sync", "FB_SYNC_", klass="IntFlag"),
53-
CEnum("VarMode", "FB_VMODE_", klass="IntFlag"),
59+
CEnum("VarMode", "FB_VMODE_", klass="IntFlag", filter=no_mask),
5460
CEnum("Rotation", "FB_ROTATE_"),
5561
CEnum("VESABlank", "VESA_"),
5662
CEnum("VarBlank", "FB_VBLANK_", klass="IntFlag"),

linuxpy/fb/device.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def get_fix_screen_info(fd) -> FixScreenInfo:
5656
return _translate_fix_fix_screen_info(info)
5757

5858

59-
def get_raw_var_screen_info(fd):
59+
def get_raw_var_screen_info(fd) -> raw.fb_var_screeninfo:
6060
return ioctl(fd, raw.IOC.GET_VSCREENINFO, raw.fb_var_screeninfo())
6161

6262

linuxpy/fb/raw.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
# Distributed under the GPLv3 license. See LICENSE for more info.
66

77
# This file has been generated by __main__
8-
# Date: 2025-01-31 11:43:12.530033
8+
# Date: 2025-02-05 10:55:50.155347
99
# System: Linux
1010
# Release: 6.8.0-51-generic
1111
# Version: #52-Ubuntu SMP PREEMPT_DYNAMIC Thu Dec 5 13:09:44 UTC 2024
@@ -32,7 +32,6 @@ class Text(enum.IntEnum):
3232
MGA_STEP16 = 3 # MGA Millenium I: text, attr, 14 reserved bytes
3333
MGA_STEP8 = 4 # other MGAs: text, attr, 6 reserved bytes
3434
SVGA_GROUP = 8 # 8-15: SVGA tileblit compatible modes
35-
SVGA_MASK = 7 # lower three bits says step
3635
SVGA_STEP2 = 8 # SVGA text mode: text, attr
3736
SVGA_STEP4 = 9 # SVGA text mode: text, attr, 2 reserved bytes
3837
SVGA_STEP8 = 10 # SVGA text mode: text, attr, 6 reserved bytes
@@ -140,6 +139,18 @@ class Acceleration(enum.IntEnum):
140139
PUV3_UNIGFX = 0xA0 # PKUnity-v3 Unigfx
141140

142141

142+
class Activate(enum.IntFlag):
143+
NOW = 0 # set values immediately (or vbl)
144+
NXTOPEN = 1 # activate on next open
145+
TEST = 2 # don't set, round up impossible
146+
VBL = 16 # activate values on next vbl
147+
CMAP_VBL = 32 # change colormap on vbl
148+
ALL = 64 # change all VCs on this fb
149+
FORCE = 128 # force apply even when no change
150+
INV_MODE = 256 # invalidate videomode
151+
KD_TEXT = 512 # for KDSET vt ioctl
152+
153+
143154
class Sync(enum.IntFlag):
144155
HOR_HIGH_ACT = 1 # horizontal sync high active
145156
VERT_HIGH_ACT = 2 # vertical sync high active
@@ -154,7 +165,6 @@ class VarMode(enum.IntFlag):
154165
INTERLACED = 1 # cinterlaced
155166
DOUBLE = 2 # double scan
156167
ODD_FLD_FIRST = 4 # cinterlaced: top line first
157-
MASK = 0xFF
158168
YWRAP = 256 # ywrap instead of panning
159169
SMOOTH_XPAN = 512 # smooth xpan possible (internally used)
160170
CONUPDATE = 512 # don't update x/yoffset

0 commit comments

Comments
 (0)