Lines Matching refs:blt

128 			      struct sna_blt_state *blt,
137 blt->bo[0] = bo;
139 blt->br13 = bo->pitch;
140 blt->cmd = XY_SCANLINE_BLT;
142 blt->cmd |= BLT_DST_TILED;
143 blt->br13 >>= 2;
145 assert(blt->br13 <= MAXSHORT);
156 blt->br13 |= 1<<31 | (fill_ROP[alu] << 16);
159 case 32: blt->br13 |= 1 << 25; /* RGB8888 */
160 case 16: blt->br13 |= 1 << 24; /* RGB565 */
164 blt->pixel = pixel;
165 blt->bpp = bpp;
166 blt->alu = alu;
200 b[1] = blt->br13;
220 b[1] = blt->br13;
246 const struct sna_blt_state *blt)
251 kgem_bcs_set_tiling(&sna->kgem, NULL, blt->bo[0]);
257 if (blt->bpp == 32)
259 if (blt->bo[0]->tiling)
261 b[1] = blt->br13;
265 kgem_add_reloc64(kgem, kgem->nbatch + 4, blt->bo[0],
270 b[6] = blt->pixel;
271 b[7] = blt->pixel;
277 if (blt->bpp == 32)
279 if (blt->bo[0]->tiling && kgem->gen >= 040)
281 b[1] = blt->br13;
284 b[4] = kgem_add_reloc(kgem, kgem->nbatch + 4, blt->bo[0],
289 b[5] = blt->pixel;
290 b[6] = blt->pixel;
298 const struct sna_blt_state *blt)
305 kgem_bcs_set_tiling(kgem, NULL, blt->bo[0]);
309 __sna_blt_fill_begin(sna, blt);
313 const struct sna_blt_state *blt,
321 __FUNCTION__, x, y, width, height, blt->pixel));
325 assert((y+height) * blt->bo[0]->pitch <= kgem_bo_size(blt->bo[0]));
328 sna_blt_fill_begin(sna, blt);
335 b[0] = blt->cmd;
341 struct sna_blt_state *blt,
352 blt->bo[0] = src;
353 blt->bo[1] = dst;
355 blt->cmd = XY_SRC_COPY_BLT_CMD | (kgem->gen >= 0100 ? 8 : 6);
357 blt->cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
359 blt->pitch[0] = src->pitch;
361 blt->cmd |= BLT_SRC_TILED;
362 blt->pitch[0] >>= 2;
364 assert(blt->pitch[0] <= MAXSHORT);
366 blt->pitch[1] = dst->pitch;
368 blt->cmd |= BLT_DST_TILED;
369 blt->pitch[1] >>= 2;
371 assert(blt->pitch[1] <= MAXSHORT);
373 blt->overwrites = alu == GXcopy || alu == GXclear || alu == GXset;
374 blt->br13 = (copy_ROP[alu] << 16) | blt->pitch[1];
377 case 32: blt->br13 |= 1 << 25; /* RGB8888 */
378 case 16: blt->br13 |= 1 << 24; /* RGB565 */
396 struct sna_blt_state *blt,
408 blt->bo[0] = src;
409 blt->bo[1] = dst;
411 blt->cmd = XY_FULL_MONO_PATTERN_BLT | (kgem->gen >= 0100 ? 12 : 10);
412 blt->pitch[0] = src->pitch;
414 blt->cmd |= BLT_SRC_TILED;
415 blt->pitch[0] >>= 2;
417 assert(blt->pitch[0] <= MAXSHORT);
419 blt->pitch[1] = dst->pitch;
421 blt->cmd |= BLT_DST_TILED;
422 blt->pitch[1] >>= 2;
424 assert(blt->pitch[1] <= MAXSHORT);
426 blt->overwrites = 1;
427 blt->br13 = (0xfc << 16) | blt->pitch[1];
430 case 32: blt->cmd |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
431 blt->br13 |= 1 << 25; /* RGB8888 */
432 case 16: blt->br13 |= 1 << 24; /* RGB565 */
435 blt->pixel = alpha;
451 const struct sna_blt_state *blt,
464 assert((src_y + height) * blt->bo[0]->pitch <= kgem_bo_size(blt->bo[0]));
467 assert((dst_y + height) * blt->bo[1]->pitch <= kgem_bo_size(blt->bo[1]));
475 kgem_bcs_set_tiling(&sna->kgem, blt->bo[0], blt->bo[1]);
480 b[0] = blt->cmd;
481 b[1] = blt->br13;
486 kgem_add_reloc64(kgem, kgem->nbatch + 4, blt->bo[1],
491 b[6] = blt->pitch[0];
494 kgem_add_reloc64(kgem, kgem->nbatch + 8, blt->bo[0],
498 b[10] = blt->pixel;
499 b[11] = blt->pixel;
504 b[4] = kgem_add_reloc(kgem, kgem->nbatch + 4, blt->bo[1],
509 b[5] = blt->pitch[0];
511 b[7] = kgem_add_reloc(kgem, kgem->nbatch + 7, blt->bo[0],
515 b[8] = blt->pixel;
516 b[9] = blt->pixel;
525 const struct sna_blt_state *blt,
538 assert((src_y + height) * blt->bo[0]->pitch <= kgem_bo_size(blt->bo[0]));
541 assert((dst_y + height) * blt->bo[1]->pitch <= kgem_bo_size(blt->bo[1]));
546 if (blt->overwrites &&
547 kgem->reloc[kgem->nreloc-1].target_handle == blt->bo[1]->target_handle) {
550 kgem->batch[kgem->nbatch-7] == (XY_COLOR_BLT | (blt->cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 5) &&
557 b[0] = blt->cmd;
558 b[1] = blt->br13;
560 b[7] = blt->pitch[0];
562 kgem_add_reloc64(kgem, kgem->nbatch + 8 - 7, blt->bo[0],
575 kgem->batch[kgem->nbatch-6] == (XY_COLOR_BLT | (blt->cmd & (BLT_DST_TILED | BLT_WRITE_ALPHA | BLT_WRITE_RGB)) | 4) &&
582 b[0] = blt->cmd;
583 b[1] = blt->br13;
585 b[6] = blt->pitch[0];
586 b[7] = kgem_add_reloc(kgem, kgem->nbatch + 7 - 6, blt->bo[0],
604 kgem_bcs_set_tiling(&sna->kgem, blt->bo[0], blt->bo[1]);
609 b[0] = blt->cmd;
610 b[1] = blt->br13;
615 kgem_add_reloc64(kgem, kgem->nbatch + 4, blt->bo[1],
621 b[7] = blt->pitch[0];
623 kgem_add_reloc64(kgem, kgem->nbatch + 8, blt->bo[0],
629 b[4] = kgem_add_reloc(kgem, kgem->nbatch + 4, blt->bo[1],
635 b[6] = blt->pitch[0];
636 b[7] = kgem_add_reloc(kgem, kgem->nbatch + 7, blt->bo[0],
983 sna_blt_fill_one(sna, &op->u.blt, x1, y1, x2-x1, y2-y1);
1018 op->u.blt.pixel);
1038 op->u.blt.pixel);
1059 op->u.blt.pixel);
1082 op->u.blt.pixel);
1104 op->u.blt.pixel);
1110 const struct sna_blt_state *blt,
1118 blt->pixel));
1122 assert(box->y2 * blt->bo[0]->pitch <= kgem_bo_size(blt->bo[0]));
1125 sna_blt_fill_begin(sna, blt);
1132 b[0] = blt->cmd;
1137 const struct sna_blt_state *blt,
1142 uint32_t cmd = blt->cmd;
1144 DBG(("%s: %08x x %d\n", __FUNCTION__, blt->pixel, nbox));
1147 sna_blt_fill_begin(sna, blt);
1196 sna_blt_fill_begin(sna, blt);
1209 priv->clear_color = op->u.blt.pixel;
1213 op->u.blt.pixel));
1223 _sna_blt_fill_box(sna, &op->u.blt, box);
1231 _sna_blt_fill_boxes(sna, &op->u.blt, box, n);
1239 const struct sna_blt_state *blt = &op->u.blt;
1240 uint32_t cmd = blt->cmd;
1242 DBG(("%s: %08x x %d\n", __FUNCTION__, blt->pixel, nbox));
1248 sna_blt_fill_begin(sna, blt);
1304 sna_blt_fill_begin(sna, blt);
1313 sna_blt_fill_one(sna, &op->u.blt,
1326 sna_blt_fill_one(sna, &op->u.blt,
1352 const struct sna_blt_state *blt = &op->u.blt;
1353 uint32_t cmd = blt->cmd;
1357 DBG(("%s: %08x x %d\n", __FUNCTION__, blt->pixel, nbox));
1363 sna_blt_fill_begin(sna, blt);
1419 sna_blt_fill_begin(sna, blt);
1466 op->blt = blt_composite_nop;
1480 op->u.blt.pixel = 0;
1481 op->blt = blt_composite_fill__cpu;
1495 op->blt = blt_composite_fill;
1507 if (!sna_blt_fill_init(sna, &op->u.blt,
1524 op->u.blt.pixel = pixel;
1525 op->blt = blt_composite_fill__cpu;
1539 op->blt = blt_composite_fill;
1551 if (!sna_blt_fill_init(sna, &op->u.blt, op->dst.bo,
1580 src_x = r->src.x - x1 + op->u.blt.sx;
1581 src_y = r->src.y - y1 + op->u.blt.sy;
1600 sna_blt_copy_one(sna, &op->u.blt,
1612 sna_blt_copy_one(sna, &op->u.blt,
1613 box->x1 + op->u.blt.sx,
1614 box->y1 + op->u.blt.sy,
1629 sna_blt_copy_one(sna, &op->u.blt,
1630 box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy,
1653 uint32_t cmd = op->u.blt.cmd;
1654 uint32_t br13 = op->u.blt.br13;
1655 struct kgem_bo *src_bo = op->u.blt.bo[0];
1656 struct kgem_bo *dst_bo = op->u.blt.bo[1];
1657 int src_pitch = op->u.blt.pitch[0];
1791 uint32_t cmd = op->u.blt.cmd;
1792 uint32_t br13 = op->u.blt.br13;
1793 struct kgem_bo *src_bo = op->u.blt.bo[0];
1794 struct kgem_bo *dst_bo = op->u.blt.bo[1];
1795 int src_pitch = op->u.blt.pitch[0];
1945 src_x = r->src.x - x1 + op->u.blt.sx;
1946 src_y = r->src.y - y1 + op->u.blt.sy;
1965 sna_blt_alpha_fixup_one(sna, &op->u.blt,
1978 sna_blt_alpha_fixup_one(sna, &op->u.blt,
1979 box->x1 + op->u.blt.sx,
1980 box->y1 + op->u.blt.sy,
1996 sna_blt_alpha_fixup_one(sna, &op->u.blt,
1997 box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy,
2010 PixmapPtr src = op->u.blt.src_pixmap;
2038 op->blt = blt_composite_copy_with_alpha;
2042 if (!sna_blt_alpha_fixup_init(sna, &op->u.blt, bo, op->dst.bo,
2047 op->blt = blt_composite_copy;
2055 if (!sna_blt_copy_init(sna, &op->u.blt, bo, op->dst.bo,
2070 PixmapPtr src = op->u.blt.src_pixmap;
2077 r->src.x + op->u.blt.sx, r->src.y + op->u.blt.sy,
2088 PixmapPtr src = op->u.blt.src_pixmap;
2095 box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy,
2106 PixmapPtr src = op->u.blt.src_pixmap;
2114 box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy,
2127 PixmapPtr src = op->u.blt.src_pixmap;
2134 r->src.x + op->u.blt.sx, r->src.y + op->u.blt.sy,
2137 0xffffffff, op->u.blt.pixel);
2147 PixmapPtr src = op->u.blt.src_pixmap;
2154 box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy,
2157 0xffffffff, op->u.blt.pixel);
2166 PixmapPtr src = op->u.blt.src_pixmap;
2174 box->x1 + op->u.blt.sx, box->y1 + op->u.blt.sy,
2177 0xffffffff, op->u.blt.pixel);
2188 PixmapPtr src = op->u.blt.src_pixmap;
2196 int16_t src_x = r->src.x + op->u.blt.sx;
2197 int16_t src_y = r->src.y + op->u.blt.sy;
2230 PixmapPtr src = op->u.blt.src_pixmap;
2234 op->u.blt.sx, op->u.blt.sy,
2246 data += (box->y1 + op->u.blt.sy) * pitch;
2247 data += (box->x1 + op->u.blt.sx) * bpp;
2258 op->u.blt.sx, op->u.blt.sy,
2269 PixmapPtr src = op->u.blt.src_pixmap;
2273 op->u.blt.sx, op->u.blt.sy,
2286 data += (box->y1 + op->u.blt.sy) * pitch;
2287 data += (box->x1 + op->u.blt.sx) * bpp;
2298 op->u.blt.sx, op->u.blt.sy,
2311 PixmapPtr src = op->u.blt.src_pixmap;
2318 int16_t src_x = r->src.x + op->u.blt.sx;
2319 int16_t src_y = r->src.y + op->u.blt.sy;
2335 0xffffffff, op->u.blt.pixel);
2348 0xffffffff, op->u.blt.pixel);
2357 PixmapPtr src = op->u.blt.src_pixmap;
2361 op->u.blt.sx, op->u.blt.sy,
2374 data += (box->y1 + op->u.blt.sy) * pitch;
2375 data += (box->x1 + op->u.blt.sx) * bpp;
2379 0xffffffff, op->u.blt.pixel);
2385 op->u.blt.sx, op->u.blt.sy,
2387 0xffffffff, op->u.blt.pixel);
2396 PixmapPtr src = op->u.blt.src_pixmap;
2400 op->u.blt.sx, op->u.blt.sy,
2414 data += (box->y1 + op->u.blt.sy) * pitch;
2415 data += (box->x1 + op->u.blt.sx) * bpp;
2419 0xffffffff, op->u.blt.pixel);
2425 op->u.blt.sx, op->u.blt.sy,
2427 0xffffffff, op->u.blt.pixel);
2443 op->u.blt.pixel = alpha_fixup;
2444 op->blt = blt_put_composite_with_alpha;
2448 op->blt = blt_put_composite;
2457 op->u.blt.pixel = alpha_fixup;
2458 op->blt = blt_put_composite_with_alpha__cpu;
2462 op->blt = blt_put_composite__cpu;
2847 tmp->u.blt.src_pixmap = src_pixmap;
2848 tmp->u.blt.sx = x - dst_x;
2849 tmp->u.blt.sy = y - dst_y;
2850 DBG(("%s: blt dst offset (%d, %d), source offset (%d, %d), with alpha fixup? %x\n",
2852 tmp->dst.x, tmp->dst.y, tmp->u.blt.sx, tmp->u.blt.sy, alpha_fixup));
3012 DBG(("%s: cannot blt from src or to dst\n", __FUNCTION__));
3078 DBG(("%s: blt dst offset (%d, %d), source offset (%d, %d), with alpha fixup? %x\n",
3082 tmp->u.blt.src_pixmap = NULL;
3083 tmp->u.blt.sx = sx;
3084 tmp->u.blt.sy = sy;
3101 tmp->blt = blt_composite_copy_with_alpha;
3105 if (!sna_blt_alpha_fixup_init(sna, &tmp->u.blt,
3111 tmp->blt = blt_composite_copy;
3119 if (!sna_blt_copy_init(sna, &tmp->u.blt,
3138 if (sna->blt_state.fill_bo != op->base.u.blt.bo[0]->unique_id) {
3139 const struct sna_blt_state *blt = &op->base.u.blt;
3141 __sna_blt_fill_begin(sna, blt);
3143 sna->blt_state.fill_bo = blt->bo[0]->unique_id;
3144 sna->blt_state.fill_pixel = blt->pixel;
3145 sna->blt_state.fill_alu = blt->alu;
3148 sna_blt_fill_one(sna, &op->base.u.blt, x, y, width, height);
3155 if (sna->blt_state.fill_bo != op->base.u.blt.bo[0]->unique_id) {
3156 const struct sna_blt_state *blt = &op->base.u.blt;
3158 __sna_blt_fill_begin(sna, blt);
3160 sna->blt_state.fill_bo = blt->bo[0]->unique_id;
3161 sna->blt_state.fill_pixel = blt->pixel;
3162 sna->blt_state.fill_alu = blt->alu;
3165 _sna_blt_fill_box(sna, &op->base.u.blt, box);
3173 if (sna->blt_state.fill_bo != op->base.u.blt.bo[0]->unique_id) {
3174 const struct sna_blt_state *blt = &op->base.u.blt;
3176 __sna_blt_fill_begin(sna, blt);
3178 sna->blt_state.fill_bo = blt->bo[0]->unique_id;
3179 sna->blt_state.fill_pixel = blt->pixel;
3180 sna->blt_state.fill_alu = blt->alu;
3183 _sna_blt_fill_boxes(sna, &op->base.u.blt, box, nbox);
3204 const struct sna_blt_state *blt = &op->base.u.blt;
3208 DBG(("%s: %08x x %d\n", __FUNCTION__, blt->pixel, n));
3210 if (sna->blt_state.fill_bo != op->base.u.blt.bo[0]->unique_id) {
3211 __sna_blt_fill_begin(sna, blt);
3213 sna->blt_state.fill_bo = blt->bo[0]->unique_id;
3214 sna->blt_state.fill_pixel = blt->pixel;
3215 sna->blt_state.fill_alu = blt->alu;
3219 sna_blt_fill_begin(sna, blt);
3222 if (kgem->gen >= 040 && op->base.u.blt.bo[0]->tiling)
3255 sna_blt_fill_begin(sna, blt);
3276 if (!sna_blt_fill_init(sna, &fill->base.u.blt,
3281 fill->blt = sna_blt_fill_op_blt;
3296 sna_blt_copy_one(sna, &op->base.u.blt,
3318 if (!sna_blt_copy_init(sna, &op->base.u.blt,
3323 op->blt = sna_blt_copy_op_blt;
3367 /* All too frequently one blt completely overwrites the previous */
3495 DBG(("%s: fallback -- cannot blt to dst\n", __FUNCTION__));
3716 DBG(("%s: cannot blt to src? %d or dst? %d\n",
4066 DBG(("%s: cannot blt to src? %d or dst? %d\n",