Lines Matching refs:scr
88 struct s3c24x0_lcd_screen *scr);
186 struct s3c24x0_lcd_screen *scr) in s3c24x0_lcd_start_dma() argument
196 int depth = scr->depth; in s3c24x0_lcd_start_dma()
197 int stride = scr->stride; in s3c24x0_lcd_start_dma()
240 pa = scr->segs[0].ds_addr; in s3c24x0_lcd_start_dma()
272 init_palette(sc, scr); in s3c24x0_lcd_start_dma()
312 struct s3c24x0_lcd_screen *scr = NULL; in s3c24x0_lcd_new_screen() local
341 scr = kmem_zalloc(sizeof *scr, KM_SLEEP); in s3c24x0_lcd_new_screen()
342 scr->nsegs = 0; in s3c24x0_lcd_new_screen()
343 scr->depth = depth; in s3c24x0_lcd_new_screen()
344 scr->stride = virtual_width * depth / 8; in s3c24x0_lcd_new_screen()
345 scr->buf_size = size = scr->stride * virtual_height; in s3c24x0_lcd_new_screen()
346 scr->buf_va = NULL; in s3c24x0_lcd_new_screen()
358 scr->segs, 1, &(scr->nsegs), busdma_flag); in s3c24x0_lcd_new_screen()
360 if (error || scr->nsegs != 1) in s3c24x0_lcd_new_screen()
363 error = bus_dmamem_map(sc->dma_tag, scr->segs, scr->nsegs, in s3c24x0_lcd_new_screen()
364 size, (void **)&(scr->buf_va), busdma_flag | BUS_DMA_COHERENT); in s3c24x0_lcd_new_screen()
369 memset (scr->buf_va, 0, scr->buf_size); in s3c24x0_lcd_new_screen()
373 1024*1024*2, 0, busdma_flag, &scr->dma)) in s3c24x0_lcd_new_screen()
375 error = bus_dmamap_load(sc->dma_tag, scr->dma, in s3c24x0_lcd_new_screen()
376 scr->buf_va, size, NULL, busdma_flag); in s3c24x0_lcd_new_screen()
380 LIST_INSERT_HEAD(&(sc->screens), scr, link); in s3c24x0_lcd_new_screen()
384 draw_test_pattern(sc, scr); in s3c24x0_lcd_new_screen()
387 return scr; in s3c24x0_lcd_new_screen()
390 if (scr) { in s3c24x0_lcd_new_screen()
391 if (scr->buf_va) in s3c24x0_lcd_new_screen()
392 bus_dmamem_unmap(sc->dma_tag, scr->buf_va, size); in s3c24x0_lcd_new_screen()
393 if (scr->nsegs) in s3c24x0_lcd_new_screen()
394 bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs); in s3c24x0_lcd_new_screen()
395 kmem_free(scr, sizeof(*scr)); in s3c24x0_lcd_new_screen()
433 init_palette(struct s3c24x0_lcd_softc *sc, struct s3c24x0_lcd_screen *scr) in init_palette() argument
435 int depth = scr->depth; in init_palette()
494 struct s3c24x0_lcd_screen *scr = cookie, *old; in s3c24x0_lcd_show_screen() local
499 if (old == scr && sc->lcd_on) in s3c24x0_lcd_show_screen()
505 s3c24x0_lcd_start_dma(sc, scr); in s3c24x0_lcd_show_screen()
506 sc->active = scr; in s3c24x0_lcd_show_screen()
519 struct s3c24x0_lcd_screen *scr; in s3c24x0_lcd_alloc_screen() local
534 scr = s3c24x0_lcd_new_screen(sc, width, height, type->depth); in s3c24x0_lcd_alloc_screen()
535 if (scr == NULL) in s3c24x0_lcd_alloc_screen()
541 scr->rinfo.ri_flg = 0; in s3c24x0_lcd_alloc_screen()
542 scr->rinfo.ri_depth = type->depth; in s3c24x0_lcd_alloc_screen()
543 scr->rinfo.ri_bits = scr->buf_va; in s3c24x0_lcd_alloc_screen()
544 scr->rinfo.ri_width = width; in s3c24x0_lcd_alloc_screen()
545 scr->rinfo.ri_height = height; in s3c24x0_lcd_alloc_screen()
546 scr->rinfo.ri_stride = scr->stride; in s3c24x0_lcd_alloc_screen()
561 if (wsfont_lock(cookie, &scr->rinfo.ri_font)) in s3c24x0_lcd_alloc_screen()
562 scr->rinfo.ri_wsfcookie = cookie; in s3c24x0_lcd_alloc_screen()
566 rasops_init(&scr->rinfo, type->c.nrows, type->c.ncols); in s3c24x0_lcd_alloc_screen()
568 (* scr->rinfo.ri_ops.allocattr)(&scr->rinfo, 0, 0, 0, attrp); in s3c24x0_lcd_alloc_screen()
570 if (type->c.nrows != scr->rinfo.ri_rows || in s3c24x0_lcd_alloc_screen()
571 type->c.ncols != scr->rinfo.ri_cols) { in s3c24x0_lcd_alloc_screen()
577 scr->rinfo.ri_cols, scr->rinfo.ri_rows); in s3c24x0_lcd_alloc_screen()
580 *cookiep = scr; in s3c24x0_lcd_alloc_screen()
592 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_free_screen() local
594 LIST_REMOVE(scr, link); in s3c24x0_lcd_free_screen()
596 if (scr == sc->active) { in s3c24x0_lcd_free_screen()
605 if (scr->buf_va) in s3c24x0_lcd_free_screen()
606 bus_dmamem_unmap(sc->dma_tag, scr->buf_va, scr->map_size); in s3c24x0_lcd_free_screen()
608 if (scr->nsegs > 0) in s3c24x0_lcd_free_screen()
609 bus_dmamem_free(sc->dma_tag, scr->segs, scr->nsegs); in s3c24x0_lcd_free_screen()
611 kmem_free(scr, sizeof(*scr)); in s3c24x0_lcd_free_screen()
620 struct s3c24x0_lcd_screen *scr; in s3c24x0_lcd_ioctl() local
647 scr = sc->active; in s3c24x0_lcd_ioctl()
648 if (scr == NULL) in s3c24x0_lcd_ioctl()
649 scr = LIST_FIRST(&sc->screens); in s3c24x0_lcd_ioctl()
651 if (scr == NULL) in s3c24x0_lcd_ioctl()
654 s3c24x0_lcd_show_screen(sc, scr, 1, NULL, NULL); in s3c24x0_lcd_ioctl()
739 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_cursor() local
741 (* scr->rinfo.ri_ops.cursor)(&scr->rinfo, on, row, col); in s3c24x0_lcd_cursor()
747 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_mapchar() local
749 return (* scr->rinfo.ri_ops.mapchar)(&scr->rinfo, c, cp); in s3c24x0_lcd_mapchar()
755 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_putchar() local
757 (* scr->rinfo.ri_ops.putchar)(&scr->rinfo, in s3c24x0_lcd_putchar()
764 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_copycols() local
766 (* scr->rinfo.ri_ops.copycols)(&scr->rinfo, in s3c24x0_lcd_copycols()
773 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_erasecols() local
775 (* scr->rinfo.ri_ops.erasecols)(&scr->rinfo, in s3c24x0_lcd_erasecols()
782 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_copyrows() local
784 (* scr->rinfo.ri_ops.copyrows)(&scr->rinfo, in s3c24x0_lcd_copyrows()
791 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_eraserows() local
793 (* scr->rinfo.ri_ops.eraserows)(&scr->rinfo, in s3c24x0_lcd_eraserows()
800 struct s3c24x0_lcd_screen *scr = cookie; in s3c24x0_lcd_alloc_attr() local
802 return (* scr->rinfo.ri_ops.allocattr)(&scr->rinfo, in s3c24x0_lcd_alloc_attr()