-
-
-unsigned
-panfrost_swizzled_size(int width, int height, int bytes_per_pixel)
-{
- /* Calculate maximum size, overestimating a bit */
- int block_pitch = ALIGN(width, 16) >> 4;
- unsigned sz = bytes_per_pixel * 256 * ((height >> 4) + 1) * block_pitch;
-
- return sz;
-}
-
-#if 0
-#include <stdio.h>
-#include <stdlib.h>
-#include <memory.h>
-#define TW 1920
-#define TH 1080
-void
-main()
-{
- panfrost_generate_space_filler_indices();
-
- uint8_t in[TW * TH * 4];
-
- for (int i = 0; i < TW * TH * 4; ++i) in[i] = i;
-
- uint8_t *out = malloc(TW * TH * 4 * 2);
-
- for (int i = 0; i < 60; ++i) {
- //swizzle_bpp4_align16(TW, TH, TW*4, TW>>4, (uint32_t *) in, (uint32_t *) out);
- //panfrost_texture_swizzle_bpp4(TW, TH, TW*4, (uint32_t *) in, (uint32_t *) out);
- //panfrost_texture_swizzle(TW, TH, 4, TW*4, (uint32_t *) in, (uint32_t *) out);
-
- int block_pitch = ALIGN(TW, 16) >> 4;
- swizzle_bpp1_align16(TW, TH, TW, (block_pitch * 256 >> 4), in, (uint8_t *) out);
- }
-
-#if 0
- uint8_t *reference = malloc(TW * TH * 4 * 2);
- panfrost_texture_swizzle(TW, TH, 1, TW, (uint8_t *) in, (uint8_t *) reference);
-
- if (memcmp(reference, out, TW * TH * 4)) printf("XXX\n");
-
-#endif
- printf("ref %X\n", out[0]);
-}
-#endif