-static void
-tu_tiling_config_get_tile(const struct tu_framebuffer *fb,
- uint32_t tx,
- uint32_t ty,
- uint32_t *pipe,
- uint32_t *slot)
-{
- /* find the pipe and the slot for tile (tx, ty) */
- const uint32_t px = tx / fb->pipe0.width;
- const uint32_t py = ty / fb->pipe0.height;
- const uint32_t sx = tx - fb->pipe0.width * px;
- const uint32_t sy = ty - fb->pipe0.height * py;
- /* last pipe has different width */
- const uint32_t pipe_width =
- MIN2(fb->pipe0.width,
- fb->tile_count.width - px * fb->pipe0.width);
-
- assert(tx < fb->tile_count.width && ty < fb->tile_count.height);
- assert(px < fb->pipe_count.width && py < fb->pipe_count.height);
- assert(sx < fb->pipe0.width && sy < fb->pipe0.height);
-
- /* convert to 1D indices */
- *pipe = fb->pipe_count.width * py + px;
- *slot = pipe_width * sy + sx;
-}
-