cmap
#define isglob(c) cmap(c, _GLOB)
if (cmap(*p, _DOL | QUOTES)) { /* $, \, ', ", ` */
if (cmap(c, _SP | _NL | _QF | _QB)) { /* sp \t\n'"` */
if (cmap(c, QUOTES))
if (cmap(c, QUOTES))
if (cmap(c, QUOTES))
while (!cmap(c, _ESC | _META | _QF | _QB) && !any("${}:", c)) {
if (cmap(c, _META | _ESC))
else if (cmap(c, _META | _QF | _QB | _ESC)) {
else if (cmap(c, _QF | _QB)) { /* '"` */
if (cmap(c, _META | _QF | _QB))
rc = sisfb_getcmap(fb->cmap, cm);
rc = sisfb_putcmap(fb->cmap, cm);
bcopy(rasops_cmap, fb->cmap, sizeof(fb->cmap));
uint8_t *cmap = fb->cmap + baseidx * 3;
bus_space_write_1(fb->iot, fb->ioh, DAC_DATA, *cmap++ >> 2);
bus_space_write_1(fb->iot, fb->ioh, DAC_DATA, *cmap++ >> 2);
bus_space_write_1(fb->iot, fb->ioh, DAC_DATA, *cmap++ >> 2);
uint8_t cmap[256 * 3];
sisfb_getcmap(uint8_t *cmap, struct wsdisplay_cmap *cm)
src = cmap + index;
src = cmap + index + 1;
src = cmap + index + 2;
sisfb_putcmap(uint8_t *cmap, struct wsdisplay_cmap *cm)
dst = cmap + index;
dst = cmap + index + 1;
dst = cmap + index + 2;
struct hwcmap cmap;
error = copyin(p->red, &cmap.r[index], count);
error = copyin(p->green, &cmap.g[index], count);
error = copyin(p->blue, &cmap.b[index], count);
memcpy(&sc->sc_dc->dc_cmap.r[index], &cmap.r[index], count);
memcpy(&sc->sc_dc->dc_cmap.g[index], &cmap.g[index], count);
memcpy(&sc->sc_dc->dc_cmap.b[index], &cmap.b[index], count);
of_setcolors(const uint8_t *cmap, unsigned int index, unsigned int count)
bcopy(cmap, of_cmap, sizeof(of_cmap));
vgafb_getcmap(uint8_t *cmap, struct wsdisplay_cmap *cm)
src = cmap + index;
src = cmap + index + 1;
src = cmap + index + 2;
vgafb_putcmap(uint8_t *cmap, struct wsdisplay_cmap *cm)
dst = cmap + index;
dst = cmap + index + 1;
dst = cmap + index + 2;
curs->cmap.index = 0;
curs->cmap.count = 2;
error = copyout(r, curs->cmap.red, sizeof(r));
error = copyout(g, curs->cmap.green, sizeof(g));
error = copyout(b, curs->cmap.blue, sizeof(b));
if (curs->cmap.count < 2)
error = copyin(curs->cmap.red, r, sizeof(r));
error = copyin(curs->cmap.green, g, sizeof(g));
error = copyin(curs->cmap.blue, b, sizeof(b));
index = cursorp->cmap.index;
count = cursorp->cmap.count;
if ((error = copyin(&cursorp->cmap.red, &spare, count)) != 0)
if ((error = copyin(&cursorp->cmap.green, &spare, count)) != 0)
if ((error = copyin(&cursorp->cmap.blue, &spare, count)) != 0)
count = cursorp->cmap.count;
index = cursorp->cmap.index;
copyin(cursorp->cmap.red, &data->curcmap_r[index], count);
copyin(cursorp->cmap.green, &data->curcmap_g[index], count);
copyin(cursorp->cmap.blue, &data->curcmap_b[index], count);
cursorp->cmap.index = 0; /* DOCMAP */
cursorp->cmap.count = 2;
if (cursorp->cmap.red != NULL) {
error = copyout(data->curcmap_r, cursorp->cmap.red, 2);
if (cursorp->cmap.green != NULL) {
error = copyout(data->curcmap_g, cursorp->cmap.green, 2);
if (cursorp->cmap.blue != NULL) {
error = copyout(data->curcmap_b, cursorp->cmap.blue, 2);
index = cursorp->cmap.index;
count = cursorp->cmap.count;
index = cursorp->cmap.index;
count = cursorp->cmap.count;
if ((error = copyin(cursorp->cmap.red,
if ((error = copyin(cursorp->cmap.green,
if ((error = copyin(cursorp->cmap.blue,
cursorp->cmap.index = 0; /* DOCMAP */
cursorp->cmap.count = 2;
if (cursorp->cmap.red != NULL) {
error = copyout(data->curcmap_r, cursorp->cmap.red, 2);
if (cursorp->cmap.green != NULL) {
error = copyout(data->curcmap_g, cursorp->cmap.green, 2);
if (cursorp->cmap.blue != NULL) {
error = copyout(data->curcmap_b, cursorp->cmap.blue, 2);
u_int8_t cmap;
cmap = cmaptaba[fontset1] | cmaptabb[fontset2];
vga_ts_write(vh, fontsel, cmap);
cmap_deactivate(struct thermal_zone *tz, struct cmap *cm)
cmap_activate(struct thermal_zone *tz, struct cmap *cm, int32_t delta)
struct cmap *cm, *newcm;
struct cmap *cm;
tz->tz_cmaps = mallocarray(tz->tz_ncmaps, sizeof(struct cmap),
struct cmap *tz_cmaps;
struct cmap *tz_cm;
memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r));
memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g));
memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b));
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info)
ret = setcmap_pseudo_palette(cmap, info);
ret = setcmap_atomic(cmap, info);
ret = setcmap_legacy(cmap, info);
ret = fb_alloc_cmap(&info->cmap, 256, 0);
if (info->cmap.len)
fb_dealloc_cmap(&info->cmap);
static int setcmap_pseudo_palette(struct fb_cmap *cmap, struct fb_info *info)
if (cmap->start + cmap->len > 16)
for (i = 0; i < cmap->len; ++i) {
u16 red = cmap->red[i];
u16 green = cmap->green[i];
u16 blue = cmap->blue[i];
palette[cmap->start + i] = value;
static int setcmap_legacy(struct fb_cmap *cmap, struct fb_info *info)
if (cmap->start + cmap->len > crtc->gamma_size) {
memcpy(r + cmap->start, cmap->red, cmap->len * sizeof(*r));
memcpy(g + cmap->start, cmap->green, cmap->len * sizeof(*g));
memcpy(b + cmap->start, cmap->blue, cmap->len * sizeof(*b));
struct fb_cmap *cmap)
if (!size || cmap->start + cmap->len > size)
if (cmap->start || cmap->len != size) {
for (i = 0; i < cmap->start; i++) {
for (i = cmap->start + cmap->len; i < size; i++) {
for (i = 0; i < cmap->len; i++) {
lut[cmap->start + i].red = cmap->red[i];
lut[cmap->start + i].green = cmap->green[i];
lut[cmap->start + i].blue = cmap->blue[i];
static int setcmap_atomic(struct fb_cmap *cmap, struct fb_info *info)
gamma_lut = setcmap_new_gamma_lut(crtc, cmap);
int drm_fb_helper_setcmap(struct fb_cmap *cmap, struct fb_info *info);
static inline int drm_fb_helper_setcmap(struct fb_cmap *cmap,
const u_int8_t *cmap;
cmap = rasops_cmap;
cfxga_write_1(sc, CFREG_LUT_DATA, *cmap++ & 0xf0);
curs->cmap.index = 0;
curs->cmap.count = 2;
error = copyout(r, curs->cmap.red, sizeof(r));
error = copyout(g, curs->cmap.green, sizeof(g));
error = copyout(b, curs->cmap.blue, sizeof(b));
if (curs->cmap.count < 2)
error = copyin(curs->cmap.red, r, sizeof(r));
error = copyin(curs->cmap.green, g, sizeof(g));
error = copyin(curs->cmap.blue, b, sizeof(b));
u_int32_t cmap[256];
lutp = &(sc->sc_ramdac->g300.cmap[start]);
lutp = &(sc->sc_ramdac->g335.cmap[start]);
u_int32_t cmap[256];
struct wsdisplay_cmap cmap; /* color map info */
cmap_init(&s->cmap,
cmap_init(&s->cmap,
cmap_do(&s->cmap, in, out, s->vol, ocnt, 1);
cmap_do(&s->cmap, in, s->resampbuf ? s->resampbuf : out, ADATA_UNIT, icnt, 0);
struct cmap cmap; /* channel mapper state */
cmap_add(struct cmap *p, void *in, void *out, int vol, int todo)
cmap_copy(struct cmap *p, void *in, void *out, int vol, int todo)
cmap_do(struct cmap *p, adata_t *in, adata_t *out, int vol, int todo, int mix)
void (*copy_func)(struct cmap *, void *, void *, int, int);
cmap_init(struct cmap *p,
void cmap_do(struct cmap *, adata_t *, adata_t *, int, int, int);
void cmap_init(struct cmap *, int, int, int, int, int, int, int, int, int);
cmap_init(&s->mix.cmap,
cmap_do(&s->mix.cmap, in, odata,
struct cmap cmap; /* channel mapper state */
struct cmap cmap_rec; /* rec channel mapper state */
struct cmap cmap_mon; /* mon channel mapper state */
cmap_add(struct cmap *p, void *in, void *out, int vol, int todo)
cmap_copy(struct cmap *p, void *in, void *out, int vol, int todo)
cmap_do(struct cmap *p, adata_t *in, adata_t *out, int vol, int todo, int mix)
void (*copy_func)(struct cmap *, void *, void *, int, int);
cmap_init(struct cmap *p,
void cmap_do(struct cmap *, adata_t *, adata_t *, int, int, int);
void cmap_init(struct cmap *, int, int, int, int, int, int, int, int, int);