Lines Matching full:cfg
66 #define gsc_write(cfg, offset) writel(cfg, ctx->regs + (offset)) argument
381 u32 cfg; in gsc_sw_reset() local
385 cfg = (GSC_SW_RESET_SRESET); in gsc_sw_reset()
386 gsc_write(cfg, GSC_SW_RESET); in gsc_sw_reset()
390 cfg = gsc_read(GSC_SW_RESET); in gsc_sw_reset()
391 if (!cfg) in gsc_sw_reset()
396 if (cfg) { in gsc_sw_reset()
402 cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK); in gsc_sw_reset()
403 cfg |= (GSC_IN_BASE_ADDR_MASK | in gsc_sw_reset()
405 gsc_write(cfg, GSC_IN_BASE_ADDR_Y_MASK); in gsc_sw_reset()
406 gsc_write(cfg, GSC_IN_BASE_ADDR_CB_MASK); in gsc_sw_reset()
407 gsc_write(cfg, GSC_IN_BASE_ADDR_CR_MASK); in gsc_sw_reset()
409 cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK); in gsc_sw_reset()
410 cfg |= (GSC_OUT_BASE_ADDR_MASK | in gsc_sw_reset()
412 gsc_write(cfg, GSC_OUT_BASE_ADDR_Y_MASK); in gsc_sw_reset()
413 gsc_write(cfg, GSC_OUT_BASE_ADDR_CB_MASK); in gsc_sw_reset()
414 gsc_write(cfg, GSC_OUT_BASE_ADDR_CR_MASK); in gsc_sw_reset()
422 u32 cfg; in gsc_handle_irq() local
427 cfg = gsc_read(GSC_IRQ); in gsc_handle_irq()
428 cfg |= (GSC_IRQ_OR_MASK | GSC_IRQ_FRMDONE_MASK); in gsc_handle_irq()
431 cfg |= GSC_IRQ_ENABLE; in gsc_handle_irq()
433 cfg &= ~GSC_IRQ_ENABLE; in gsc_handle_irq()
436 cfg &= ~GSC_IRQ_OR_MASK; in gsc_handle_irq()
438 cfg |= GSC_IRQ_OR_MASK; in gsc_handle_irq()
441 cfg &= ~GSC_IRQ_FRMDONE_MASK; in gsc_handle_irq()
443 cfg |= GSC_IRQ_FRMDONE_MASK; in gsc_handle_irq()
445 gsc_write(cfg, GSC_IRQ); in gsc_handle_irq()
451 u32 cfg; in gsc_src_set_fmt() local
455 cfg = gsc_read(GSC_IN_CON); in gsc_src_set_fmt()
456 cfg &= ~(GSC_IN_RGB_TYPE_MASK | GSC_IN_YUV422_1P_ORDER_MASK | in gsc_src_set_fmt()
463 cfg |= GSC_IN_RGB565; in gsc_src_set_fmt()
467 cfg |= GSC_IN_XRGB8888; in gsc_src_set_fmt()
470 cfg |= (GSC_IN_XRGB8888 | GSC_IN_RB_SWAP); in gsc_src_set_fmt()
473 cfg |= (GSC_IN_YUV422_1P | in gsc_src_set_fmt()
478 cfg |= (GSC_IN_YUV422_1P | in gsc_src_set_fmt()
483 cfg |= (GSC_IN_YUV422_1P | in gsc_src_set_fmt()
488 cfg |= (GSC_IN_YUV422_1P | in gsc_src_set_fmt()
493 cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_2P); in gsc_src_set_fmt()
496 cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV422_2P); in gsc_src_set_fmt()
499 cfg |= GSC_IN_YUV422_3P; in gsc_src_set_fmt()
502 cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_3P); in gsc_src_set_fmt()
505 cfg |= (GSC_IN_CHROMA_ORDER_CRCB | GSC_IN_YUV420_3P); in gsc_src_set_fmt()
508 cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV420_2P); in gsc_src_set_fmt()
511 cfg |= (GSC_IN_CHROMA_ORDER_CBCR | GSC_IN_YUV422_2P); in gsc_src_set_fmt()
516 cfg |= (GSC_IN_TILE_C_16x8 | GSC_IN_TILE_MODE); in gsc_src_set_fmt()
518 gsc_write(cfg, GSC_IN_CON); in gsc_src_set_fmt()
524 u32 cfg; in gsc_src_set_transf() local
526 cfg = gsc_read(GSC_IN_CON); in gsc_src_set_transf()
527 cfg &= ~GSC_IN_ROT_MASK; in gsc_src_set_transf()
532 cfg |= GSC_IN_ROT_XFLIP; in gsc_src_set_transf()
534 cfg |= GSC_IN_ROT_YFLIP; in gsc_src_set_transf()
537 cfg |= GSC_IN_ROT_90; in gsc_src_set_transf()
539 cfg |= GSC_IN_ROT_XFLIP; in gsc_src_set_transf()
541 cfg |= GSC_IN_ROT_YFLIP; in gsc_src_set_transf()
544 cfg |= GSC_IN_ROT_180; in gsc_src_set_transf()
546 cfg &= ~GSC_IN_ROT_XFLIP; in gsc_src_set_transf()
548 cfg &= ~GSC_IN_ROT_YFLIP; in gsc_src_set_transf()
551 cfg |= GSC_IN_ROT_270; in gsc_src_set_transf()
553 cfg &= ~GSC_IN_ROT_XFLIP; in gsc_src_set_transf()
555 cfg &= ~GSC_IN_ROT_YFLIP; in gsc_src_set_transf()
559 gsc_write(cfg, GSC_IN_CON); in gsc_src_set_transf()
561 ctx->rotation = (cfg & GSC_IN_ROT_90) ? 1 : 0; in gsc_src_set_transf()
568 u32 cfg; in gsc_src_set_size() local
571 cfg = (GSC_SRCIMG_OFFSET_X(buf->rect.x) | in gsc_src_set_size()
573 gsc_write(cfg, GSC_SRCIMG_OFFSET); in gsc_src_set_size()
576 cfg = (GSC_CROPPED_WIDTH(buf->rect.w) | in gsc_src_set_size()
578 gsc_write(cfg, GSC_CROPPED_SIZE); in gsc_src_set_size()
581 cfg = gsc_read(GSC_SRCIMG_SIZE); in gsc_src_set_size()
582 cfg &= ~(GSC_SRCIMG_HEIGHT_MASK | in gsc_src_set_size()
585 cfg |= (GSC_SRCIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) | in gsc_src_set_size()
588 gsc_write(cfg, GSC_SRCIMG_SIZE); in gsc_src_set_size()
590 cfg = gsc_read(GSC_IN_CON); in gsc_src_set_size()
591 cfg &= ~GSC_IN_RGB_TYPE_MASK; in gsc_src_set_size()
595 cfg |= GSC_IN_RGB_HD_WIDE; in gsc_src_set_size()
597 cfg |= GSC_IN_RGB_HD_NARROW; in gsc_src_set_size()
600 cfg |= GSC_IN_RGB_SD_WIDE; in gsc_src_set_size()
602 cfg |= GSC_IN_RGB_SD_NARROW; in gsc_src_set_size()
604 gsc_write(cfg, GSC_IN_CON); in gsc_src_set_size()
611 u32 cfg; in gsc_src_set_buf_seq() local
615 cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK); in gsc_src_set_buf_seq()
618 cfg &= ~mask; in gsc_src_set_buf_seq()
619 cfg |= masked << buf_id; in gsc_src_set_buf_seq()
620 gsc_write(cfg, GSC_IN_BASE_ADDR_Y_MASK); in gsc_src_set_buf_seq()
621 gsc_write(cfg, GSC_IN_BASE_ADDR_CB_MASK); in gsc_src_set_buf_seq()
622 gsc_write(cfg, GSC_IN_BASE_ADDR_CR_MASK); in gsc_src_set_buf_seq()
638 u32 cfg; in gsc_dst_set_fmt() local
642 cfg = gsc_read(GSC_OUT_CON); in gsc_dst_set_fmt()
643 cfg &= ~(GSC_OUT_RGB_TYPE_MASK | GSC_OUT_YUV422_1P_ORDER_MASK | in gsc_dst_set_fmt()
650 cfg |= GSC_OUT_RGB565; in gsc_dst_set_fmt()
654 cfg |= (GSC_OUT_XRGB8888 | GSC_OUT_GLOBAL_ALPHA(0xff)); in gsc_dst_set_fmt()
657 cfg |= (GSC_OUT_XRGB8888 | GSC_OUT_RB_SWAP); in gsc_dst_set_fmt()
660 cfg |= (GSC_OUT_YUV422_1P | in gsc_dst_set_fmt()
665 cfg |= (GSC_OUT_YUV422_1P | in gsc_dst_set_fmt()
670 cfg |= (GSC_OUT_YUV422_1P | in gsc_dst_set_fmt()
675 cfg |= (GSC_OUT_YUV422_1P | in gsc_dst_set_fmt()
680 cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_2P); in gsc_dst_set_fmt()
683 cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV422_2P); in gsc_dst_set_fmt()
686 cfg |= GSC_OUT_YUV422_3P; in gsc_dst_set_fmt()
689 cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_3P); in gsc_dst_set_fmt()
692 cfg |= (GSC_OUT_CHROMA_ORDER_CRCB | GSC_OUT_YUV420_3P); in gsc_dst_set_fmt()
695 cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV420_2P); in gsc_dst_set_fmt()
698 cfg |= (GSC_OUT_CHROMA_ORDER_CBCR | GSC_OUT_YUV422_2P); in gsc_dst_set_fmt()
703 cfg |= (GSC_IN_TILE_C_16x8 | GSC_OUT_TILE_MODE); in gsc_dst_set_fmt()
705 gsc_write(cfg, GSC_OUT_CON); in gsc_dst_set_fmt()
747 u32 cfg; in gsc_set_prescaler() local
788 cfg = (GSC_PRESC_SHFACTOR(sc->pre_shfactor) | in gsc_set_prescaler()
791 gsc_write(cfg, GSC_PRE_SCALE_RATIO); in gsc_set_prescaler()
850 u32 cfg; in gsc_set_scaler() local
856 cfg = GSC_MAIN_H_RATIO_VALUE(sc->main_hratio); in gsc_set_scaler()
857 gsc_write(cfg, GSC_MAIN_H_RATIO); in gsc_set_scaler()
860 cfg = GSC_MAIN_V_RATIO_VALUE(sc->main_vratio); in gsc_set_scaler()
861 gsc_write(cfg, GSC_MAIN_V_RATIO); in gsc_set_scaler()
868 u32 cfg; in gsc_dst_set_size() local
871 cfg = (GSC_DSTIMG_OFFSET_X(buf->rect.x) | in gsc_dst_set_size()
873 gsc_write(cfg, GSC_DSTIMG_OFFSET); in gsc_dst_set_size()
877 cfg = (GSC_SCALED_WIDTH(buf->rect.h) | in gsc_dst_set_size()
880 cfg = (GSC_SCALED_WIDTH(buf->rect.w) | in gsc_dst_set_size()
882 gsc_write(cfg, GSC_SCALED_SIZE); in gsc_dst_set_size()
885 cfg = gsc_read(GSC_DSTIMG_SIZE); in gsc_dst_set_size()
886 cfg &= ~(GSC_DSTIMG_HEIGHT_MASK | GSC_DSTIMG_WIDTH_MASK); in gsc_dst_set_size()
887 cfg |= GSC_DSTIMG_WIDTH(buf->buf.pitch[0] / buf->format->cpp[0]) | in gsc_dst_set_size()
889 gsc_write(cfg, GSC_DSTIMG_SIZE); in gsc_dst_set_size()
891 cfg = gsc_read(GSC_OUT_CON); in gsc_dst_set_size()
892 cfg &= ~GSC_OUT_RGB_TYPE_MASK; in gsc_dst_set_size()
896 cfg |= GSC_OUT_RGB_HD_WIDE; in gsc_dst_set_size()
898 cfg |= GSC_OUT_RGB_HD_NARROW; in gsc_dst_set_size()
901 cfg |= GSC_OUT_RGB_SD_WIDE; in gsc_dst_set_size()
903 cfg |= GSC_OUT_RGB_SD_NARROW; in gsc_dst_set_size()
905 gsc_write(cfg, GSC_OUT_CON); in gsc_dst_set_size()
910 u32 cfg, i, buf_num = GSC_REG_SZ; in gsc_dst_get_buf_seq() local
913 cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK); in gsc_dst_get_buf_seq()
916 if (cfg & (mask << i)) in gsc_dst_get_buf_seq()
928 u32 cfg; in gsc_dst_set_buf_seq() local
932 cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK); in gsc_dst_set_buf_seq()
935 cfg &= ~mask; in gsc_dst_set_buf_seq()
936 cfg |= masked << buf_id; in gsc_dst_set_buf_seq()
937 gsc_write(cfg, GSC_OUT_BASE_ADDR_Y_MASK); in gsc_dst_set_buf_seq()
938 gsc_write(cfg, GSC_OUT_BASE_ADDR_CB_MASK); in gsc_dst_set_buf_seq()
939 gsc_write(cfg, GSC_OUT_BASE_ADDR_CR_MASK); in gsc_dst_set_buf_seq()
963 u32 cfg, curr_index, i; in gsc_get_src_buf_index() local
968 cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK); in gsc_get_src_buf_index()
969 curr_index = GSC_IN_CURR_GET_INDEX(cfg); in gsc_get_src_buf_index()
972 if (!((cfg >> i) & 0x1)) { in gsc_get_src_buf_index()
978 DRM_DEV_DEBUG_KMS(ctx->dev, "cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg, in gsc_get_src_buf_index()
993 u32 cfg, curr_index, i; in gsc_get_dst_buf_index() local
998 cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK); in gsc_get_dst_buf_index()
999 curr_index = GSC_OUT_CURR_GET_INDEX(cfg); in gsc_get_dst_buf_index()
1002 if (!((cfg >> i) & 0x1)) { in gsc_get_dst_buf_index()
1015 DRM_DEV_DEBUG_KMS(ctx->dev, "cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg, in gsc_get_dst_buf_index()
1085 u32 cfg; in gsc_start() local
1090 cfg = gsc_read(GSC_ENABLE); in gsc_start()
1091 cfg &= ~(GSC_ENABLE_ON_CLEAR_MASK | in gsc_start()
1093 cfg |= GSC_ENABLE_ON_CLEAR_ONESHOT; in gsc_start()
1094 gsc_write(cfg, GSC_ENABLE); in gsc_start()
1097 cfg = gsc_read(GSC_IN_CON); in gsc_start()
1098 cfg &= ~(GSC_IN_PATH_MASK | GSC_IN_LOCAL_SEL_MASK); in gsc_start()
1099 cfg |= GSC_IN_PATH_MEMORY; in gsc_start()
1100 gsc_write(cfg, GSC_IN_CON); in gsc_start()
1103 cfg = gsc_read(GSC_OUT_CON); in gsc_start()
1104 cfg |= GSC_OUT_PATH_MEMORY; in gsc_start()
1105 gsc_write(cfg, GSC_OUT_CON); in gsc_start()
1109 cfg = gsc_read(GSC_ENABLE); in gsc_start()
1110 cfg |= GSC_ENABLE_ON; in gsc_start()
1111 gsc_write(cfg, GSC_ENABLE); in gsc_start()