#define PANEL_FB_WIDTH_OFFSET_MASK 0x3fff
#define PANEL_WINDOW_WIDTH 0x080014
-#define PANEL_WINDOW_WIDTH_WIDTH 27:16
-#define PANEL_WINDOW_WIDTH_X 11:0
+#define PANEL_WINDOW_WIDTH_WIDTH_SHIFT 16
+#define PANEL_WINDOW_WIDTH_WIDTH_MASK (0xfff << 16)
+#define PANEL_WINDOW_WIDTH_X_MASK 0xfff
#define PANEL_WINDOW_HEIGHT 0x080018
#define PANEL_WINDOW_HEIGHT_HEIGHT 27:16
reg |= (fix->line_length & PANEL_FB_WIDTH_OFFSET_MASK);
POKE32(PANEL_FB_WIDTH, reg);
- POKE32(PANEL_WINDOW_WIDTH,
- FIELD_VALUE(0, PANEL_WINDOW_WIDTH, WIDTH, var->xres - 1)|
- FIELD_VALUE(0, PANEL_WINDOW_WIDTH, X, var->xoffset));
+ reg = ((var->xres - 1) << PANEL_WINDOW_WIDTH_WIDTH_SHIFT) &
+ PANEL_WINDOW_WIDTH_WIDTH_MASK;
+ reg |= (var->xoffset & PANEL_WINDOW_WIDTH_X_MASK);
+ POKE32(PANEL_WINDOW_WIDTH, reg);
POKE32(PANEL_WINDOW_HEIGHT,
FIELD_VALUE(0, PANEL_WINDOW_HEIGHT, HEIGHT, var->yres_virtual - 1)|