1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
|
/* $OpenBSD: legss.c,v 1.3 2008/08/24 20:10:57 miod Exp $ */
/*
* Copyright (c) 2008 Miodrag Vallat.
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/*
* The wsdisplay emulops routines ({copy,erase}{cols,rows}, putchar, and
* do_cursor) are adapted from the rasops routines found in rasops.c and
* rasops32.c, under the following licence terms:
*
* Copyright (c) 1999 The NetBSD Foundation, Inc.
* All rights reserved.
*
* This code is derived from software contributed to The NetBSD Foundation
* by Andrew Doran.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* LEGSS frame buffer
*
* This beast is different enough from a QDSS or a GPX to need a specific
* driver. Unfortunately, it is not yet known how this hardware works.
*
* The frame buffer memory is accessible linearly in 32 bit words (one
* per pixel, although apparently only 20 bits are writable).
*
* We currently drive the frame buffer as a monochrome, unaccelerated
* display.
*
* Note that the hardware probe is made easier since graphics can only
* exist in the last M-Bus slot, and the terminal information in the SSC
* will tell us whether it is properly populated or not.
*/
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/device.h>
#include <sys/malloc.h>
#include <sys/conf.h>
#include <sys/kernel.h>
#include <machine/cpu.h>
#include <machine/cvax.h>
#include <machine/sid.h>
#include <vax/mbus/mbusreg.h>
#include <vax/mbus/mbusvar.h>
#include <uvm/uvm_extern.h>
#include <dev/cons.h>
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>
#include <dev/rasops/rasops.h>
#include <dev/wsfont/wsfont.h>
/* Graphics can only exist at mid 7 */
#define MID_GRAPHICS 7
#define LEGSS_BASE MBUS_SLOT_BASE(MID_GRAPHICS)
#define LEGSS_VRAM_OFFSET 0x00800000
#define LEGSS_VISWIDTH 1280
#define LEGSS_WIDTH 2048
#define LEGSS_VISHEIGHT 1024
#define LEGSS_HEIGHT 2048
int legss_match(struct device *, void *, void *);
void legss_attach(struct device *, struct device *, void *);
struct legss_screen {
struct rasops_info ss_ri;
int ss_console;
u_int ss_depth;
vaddr_t ss_vram;
};
/* for console */
struct legss_screen legss_consscr;
struct legss_softc {
struct device sc_dev;
struct legss_screen *sc_scr;
int sc_nscreens;
};
struct cfattach legss_ca = {
sizeof(struct legss_softc), legss_match, legss_attach,
};
struct cfdriver legss_cd = {
NULL, "legss", DV_DULL
};
struct wsscreen_descr legss_stdscreen = {
"std",
};
const struct wsscreen_descr *_legss_scrlist[] = {
&legss_stdscreen,
};
const struct wsscreen_list legss_screenlist = {
sizeof(_legss_scrlist) / sizeof(struct wsscreen_descr *),
_legss_scrlist,
};
int legss_ioctl(void *, u_long, caddr_t, int, struct proc *);
paddr_t legss_mmap(void *, off_t, int);
int legss_alloc_screen(void *, const struct wsscreen_descr *,
void **, int *, int *, long *);
void legss_free_screen(void *, void *);
int legss_show_screen(void *, void *, int,
void (*) (void *, int, int), void *);
const struct wsdisplay_accessops legss_accessops = {
legss_ioctl,
legss_mmap,
legss_alloc_screen,
legss_free_screen,
legss_show_screen,
NULL, /* load_font */
NULL, /* scrollback */
NULL, /* getchar */
NULL /* burner */
};
int legss_setup_screen(struct legss_screen *);
void legss_clear_screen(struct legss_screen *);
void legss_copycols(void *, int, int, int, int);
void legss_copyrows(void *, int, int, int);
void legss_do_cursor(struct rasops_info *);
void legss_erasecols(void *, int, int, int, long);
void legss_eraserows(void *, int, int, long);
void legss_putchar(void *, int, int, u_int, long);
u_int legss_probe_depth(vaddr_t);
/*
* Autoconf glue
*/
int
legss_match(struct device *parent, void *vcf, void *aux)
{
struct mbus_attach_args *maa = (struct mbus_attach_args *)aux;
if (maa->maa_class == CLASS_GRAPHICS &&
maa->maa_interface == INTERFACE_FBIC &&
maa->maa_mid == MID_GRAPHICS)
return 1;
return 0;
}
void
legss_attach(struct device *parent, struct device *self, void *aux)
{
struct legss_softc *sc = (struct legss_softc *)self;
struct legss_screen *scr;
struct wsemuldisplaydev_attach_args aa;
int console;
vaddr_t tmp;
extern struct consdev wsdisplay_cons;
console = (vax_confdata & 0x60) != 0 && cn_tab == &wsdisplay_cons;
if (console) {
scr = &legss_consscr;
sc->sc_nscreens = 1;
} else {
scr = malloc(sizeof(struct legss_screen), M_DEVBUF, M_NOWAIT);
if (scr == NULL) {
printf(": can not allocate memory\n");
return;
}
tmp = vax_map_physmem(LEGSS_BASE + LEGSS_VRAM_OFFSET, 1);
if (tmp == 0L) {
printf(": can not probe depth\n");
goto bad1;
}
scr->ss_depth = legss_probe_depth(tmp);
vax_unmap_physmem(tmp, 1);
if (scr->ss_depth == 0) {
printf(": unrecognized depth\n");
goto bad1;
}
scr->ss_vram = vax_map_physmem(LEGSS_BASE + LEGSS_VRAM_OFFSET,
(LEGSS_VISHEIGHT * LEGSS_WIDTH * 32 / NBBY) / VAX_NBPG);
if (scr->ss_vram == 0L) {
printf(": can not map frame buffer\n");
goto bad1;
}
if (legss_setup_screen(scr) != 0) {
printf(": initialization failed\n");
goto bad2;
}
}
sc->sc_scr = scr;
printf(": %dx%d %d plane color framebuffer\n",
LEGSS_VISWIDTH, LEGSS_VISHEIGHT, scr->ss_depth);
aa.console = console;
aa.scrdata = &legss_screenlist;
aa.accessops = &legss_accessops;
aa.accesscookie = sc;
aa.defaultscreens = 0;
config_found(self, &aa, wsemuldisplaydevprint);
return;
bad2:
vax_unmap_physmem(scr->ss_vram,
(LEGSS_VISHEIGHT * LEGSS_WIDTH * 32 / NBBY) / VAX_NBPG);
bad1:
free(scr, M_DEVBUF);
}
/*
* wsdisplay accessops
*/
int
legss_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
{
struct legss_softc *sc = v;
struct legss_screen *ss = sc->sc_scr;
struct wsdisplay_fbinfo *wdf;
switch (cmd) {
case WSDISPLAYIO_GTYPE:
*(u_int *)data = WSDISPLAY_TYPE_LEGSS;
break;
case WSDISPLAYIO_GINFO:
wdf = (struct wsdisplay_fbinfo *)data;
wdf->height = ss->ss_ri.ri_height;
wdf->width = ss->ss_ri.ri_width;
wdf->depth = ss->ss_depth;
wdf->cmsize = 0;
break;
case WSDISPLAYIO_LINEBYTES:
*(u_int *)data = LEGSS_WIDTH * 32 / NBBY;
case WSDISPLAYIO_GETCMAP:
case WSDISPLAYIO_PUTCMAP:
break;
case WSDISPLAYIO_GVIDEO:
case WSDISPLAYIO_SVIDEO:
break;
default:
return -1;
}
return 0;
}
paddr_t
legss_mmap(void *v, off_t offset, int prot)
{
/* Do not allow mmap yet because of the read-only upper 12 bits */
return -1;
}
int
legss_alloc_screen(void *v, const struct wsscreen_descr *type, void **cookiep,
int *curxp, int *curyp, long *defattrp)
{
struct legss_softc *sc = v;
struct legss_screen *ss = sc->sc_scr;
struct rasops_info *ri = &ss->ss_ri;
if (sc->sc_nscreens > 0)
return ENOMEM;
*cookiep = ri;
*curxp = *curyp = 0;
ri->ri_ops.alloc_attr(ri, 0, 0, 0, defattrp);
sc->sc_nscreens++;
return 0;
}
void
legss_free_screen(void *v, void *cookie)
{
struct legss_softc *sc = v;
sc->sc_nscreens--;
}
int
legss_show_screen(void *v, void *cookie, int waitok,
void (*cb)(void *, int, int), void *cbarg)
{
return 0;
}
int
legss_setup_screen(struct legss_screen *ss)
{
struct rasops_info *ri = &ss->ss_ri;
bzero(ri, sizeof(*ri));
ri->ri_depth = 32; /* masquerade as a 32 bit device for rasops */
ri->ri_width = LEGSS_VISWIDTH;
ri->ri_height = LEGSS_VISHEIGHT;
ri->ri_stride = LEGSS_WIDTH * 32 / NBBY;
ri->ri_flg = RI_FORCEMONO | RI_CENTER; /* no RI_CLEAR ! */
ri->ri_hw = ss;
ri->ri_bits = (u_char *)ss->ss_vram;
/*
* Ask for an unholy big display, rasops will trim this to more
* reasonable values.
*/
if (rasops_init(ri, 160, 160) != 0)
return -1;
/*
* Override the rasops emulops.
*/
ri->ri_ops.copyrows = legss_copyrows;
ri->ri_ops.copycols = legss_copycols;
ri->ri_ops.eraserows = legss_eraserows;
ri->ri_ops.erasecols = legss_erasecols;
ri->ri_ops.putchar = legss_putchar;
ri->ri_do_cursor = legss_do_cursor;
legss_stdscreen.ncols = ri->ri_cols;
legss_stdscreen.nrows = ri->ri_rows;
legss_stdscreen.textops = &ri->ri_ops;
legss_stdscreen.fontwidth = ri->ri_font->fontwidth;
legss_stdscreen.fontheight = ri->ri_font->fontheight;
legss_stdscreen.capabilities = ri->ri_caps;
/*
* Clear display.
*/
legss_clear_screen(ss);
return 0;
}
u_int
legss_probe_depth(vaddr_t vram)
{
uint32_t probe;
*(volatile uint32_t *)vram = 0;
*(volatile uint32_t *)vram = 0xffffffff;
probe = *(volatile uint32_t *)vram;
/*
* Need to mask the upper 12 bits, they don't seem to be connected
* to anything and latch random bus data.
*/
switch (probe & 0x000fffff) {
case 0x000ff:
return 8;
default:
return 0;
}
}
/*
* Console support code
*/
int legsscnprobe(void);
int legsscninit(void);
int
legsscnprobe()
{
extern vaddr_t virtual_avail;
int depth;
if (vax_boardtype != VAX_BTYP_60)
return 0; /* move along, nothing there */
/* no working graphics hardware, or forced serial console? */
if ((vax_confdata & 0x60) == 0)
return 0;
/*
* Check for a recognized color depth.
*/
ioaccess(virtual_avail, LEGSS_BASE + LEGSS_VRAM_OFFSET, 1);
depth = legss_probe_depth(virtual_avail);
iounaccess(virtual_avail, 1);
if (depth == 0)
return 0; /* unsupported, default to serial */
return 1;
}
/*
* Called very early to setup the glass tty as console.
* Because it's called before the VM system is initialized, virtual memory
* for the framebuffer can be stolen directly without disturbing anything.
*/
int
legsscninit()
{
struct legss_screen *ss = &legss_consscr;
extern vaddr_t virtual_avail;
vaddr_t ova;
long defattr;
struct rasops_info *ri;
ova = virtual_avail;
ioaccess(virtual_avail, LEGSS_BASE + LEGSS_VRAM_OFFSET, 1);
ss->ss_depth = legss_probe_depth(virtual_avail);
iounaccess(virtual_avail, 1);
if (ss->ss_depth == 0)
return 1;
ioaccess(virtual_avail, LEGSS_BASE + LEGSS_VRAM_OFFSET,
(LEGSS_VISHEIGHT * LEGSS_WIDTH * 32 / NBBY) / VAX_NBPG);
ss->ss_vram = virtual_avail;
virtual_avail += (LEGSS_VISHEIGHT * LEGSS_WIDTH * 32 / NBBY);
virtual_avail = round_page(virtual_avail);
/* this had better not fail */
if (legss_setup_screen(ss) != 0) {
iounaccess(ss->ss_vram,
(LEGSS_VISHEIGHT * LEGSS_WIDTH * 32 / NBBY) / VAX_NBPG);
virtual_avail = ova;
return 1;
}
ri = &ss->ss_ri;
ri->ri_ops.alloc_attr(ri, 0, 0, 0, &defattr);
wsdisplay_cnattach(&legss_stdscreen, ri, 0, 0, defattr);
return 0;
}
/*
* wsdisplay emulops
*/
void
legss_putchar(void *v, int row, int col, u_int uc, long attr)
{
struct rasops_info *ri = v;
struct wsdisplay_font *font = ri->ri_font;
int width, height, cnt, fs, fb, fg, bg, ul;
int32_t *dp, *rp;
u_char *fr;
ri->ri_ops.unpack_attr(v, attr, &fg, &bg, &ul);
rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale);
height = font->fontheight;
width = font->fontwidth;
if (uc == ' ') {
while (height--) {
dp = rp;
DELTA(rp, ri->ri_stride, int32_t *);
for (cnt = width; cnt; cnt--) {
*(int8_t *)dp = bg;
dp++;
}
}
} else {
uc -= font->firstchar;
fr = (u_char *)font->data + uc * ri->ri_fontscale;
fs = font->stride;
while (height--) {
dp = rp;
fb = fr[3] | (fr[2] << 8) | (fr[1] << 16) |
(fr[0] << 24);
fr += fs;
DELTA(rp, ri->ri_stride, int32_t *);
for (cnt = width; cnt; cnt--) {
if ((fb >> 31) & 1)
*(int8_t *)dp = fg;
else
*(int8_t *)dp = bg;
dp++;
fb <<= 1;
}
}
}
/* Do underline */
if (ul) {
DELTA(rp, -(ri->ri_stride << 1), int32_t *);
while (width--) {
*(int8_t *)rp = fg;
rp++;
}
}
}
void
legss_copycols(void *v, int row, int src, int dst, int num)
{
struct rasops_info *ri = v;
struct wsdisplay_font *font = ri->ri_font;
u_char *sp, *dp;
int height, cnt, delta;
num *= font->fontwidth;
row *= ri->ri_yscale;
height = font->fontheight;
sp = ri->ri_bits + row + src * ri->ri_xscale;
dp = ri->ri_bits + row + dst * ri->ri_xscale;
if (dst <= src) {
/* non overlapping copy */
delta = ri->ri_stride - (num << 2);
while (height--) {
for (cnt = num; cnt != 0; cnt--) {
*dp = *sp;
sp += 1 << 2;
dp += 1 << 2;
}
dp += delta;
sp += delta;
}
} else {
/* possibly overlapping copy */
delta = num << 2;
while (height--) {
dp += delta;
sp += delta;
for (cnt = num; cnt != 0; cnt--) {
dp -= 1 << 2;
sp -= 1 << 2;
*dp = *sp;
}
dp += ri->ri_stride;
sp += ri->ri_stride;
}
}
}
void
legss_erasecols(void *v, int row, int col, int num, long attr)
{
struct rasops_info *ri = v;
struct wsdisplay_font *font = ri->ri_font;
int height, cnt, fg, bg;
int32_t *rp, *dp;
ri->ri_ops.unpack_attr(v, attr, &fg, &bg, NULL);
rp = (int32_t *)(ri->ri_bits + row*ri->ri_yscale + col*ri->ri_xscale);
height = font->fontheight;
num *= font->fontwidth;
while (height--) {
dp = rp;
DELTA(rp, ri->ri_stride, int32_t *);
for (cnt = num; cnt; cnt--) {
*(int8_t *)dp = bg;
dp++;
}
}
}
void
legss_copyrows(void *v, int src, int dst, int num)
{
struct rasops_info *ri = v;
struct wsdisplay_font *font = ri->ri_font;
int32_t *srp, *drp;
int8_t *sp, *dp;
int n, cnt, delta;
num *= font->fontheight;
n = ri->ri_emustride >> 2;
if (dst < src) {
srp = (int32_t *)(ri->ri_bits + src * ri->ri_yscale);
drp = (int32_t *)(ri->ri_bits + dst * ri->ri_yscale);
delta = ri->ri_stride;
} else {
src = font->fontheight * src + num - 1;
dst = font->fontheight * dst + num - 1;
srp = (int32_t *)(ri->ri_bits + src * ri->ri_stride);
drp = (int32_t *)(ri->ri_bits + dst * ri->ri_stride);
delta = -ri->ri_stride;
}
while (num--) {
dp = (int8_t *)drp;
sp = (int8_t *)srp;
DELTA(drp, delta, int32_t *);
DELTA(srp, delta, int32_t *);
for (cnt = n; cnt; cnt--) {
*dp = *sp;
dp += 1 << 2;
sp += 1 << 2;
}
}
}
void
legss_eraserows(void *v, int row, int num, long attr)
{
struct rasops_info *ri = v;
struct wsdisplay_font *font = ri->ri_font;
int n, cnt, delta, fg, bg;
int32_t *dp;
ri->ri_ops.unpack_attr(v, attr, &fg, &bg, NULL);
n = ri->ri_emustride >> 2;
num *= font->fontheight;
dp = (int32_t *)(ri->ri_bits + row * ri->ri_yscale);
delta = ri->ri_delta;
while (num--) {
for (cnt = n; cnt; cnt--) {
*(int8_t *)dp = bg;
DELTA(dp, 4, int32_t *);
}
DELTA(dp, delta, int32_t *);
}
}
void
legss_do_cursor(struct rasops_info *ri)
{
struct wsdisplay_font *font = ri->ri_font;
int height, cnt, row, col;
u_char *dp, *rp;
row = ri->ri_crow;
col = ri->ri_ccol;
rp = ri->ri_bits + row * ri->ri_yscale + col * ri->ri_xscale;
height = font->fontheight;
while (height--) {
dp = rp;
rp += ri->ri_stride;
for (cnt = font->fontwidth; cnt; cnt--) {
*(int8_t *)dp ^= ~0;
dp += 4;
}
}
}
/* Clear the whole screen */
void
legss_clear_screen(struct legss_screen *ss)
{
struct rasops_info *ri = &ss->ss_ri;
int n, cnt, num, delta;
int32_t *dp, clr;
n = ri->ri_stride >> 2;
num = ri->ri_height;
dp = (int32_t *)ri->ri_origbits;
delta = 0;
clr = ri->ri_devcmap[0];
while (num--) {
for (cnt = n; cnt; cnt--) {
*(int8_t *)dp = clr;
DELTA(dp, 4, int32_t *);
}
DELTA(dp, delta, int32_t *);
}
}
|