}
fetchdecode_source_bpp(fd, bpp);
- fetchdecode_source_stride(fd, fb->pitches[0]);
+ fetchdecode_source_stride(fd, src_w, bpp, fb->pitches[0],
+ drm_plane_state_to_baseaddr(state), false);
fetchdecode_src_buf_dimensions(fd, src_w, src_h);
fetchdecode_set_fmt(fd, fb->pixel_format);
fetchdecode_source_buffer_enable(fd);
}
EXPORT_SYMBOL_GPL(fetchdecode_source_bpp);
-void fetchdecode_source_stride(struct dpu_fetchdecode *fd, int stride)
+void fetchdecode_source_stride(struct dpu_fetchdecode *fd, unsigned int width,
+ int bpp, unsigned int stride,
+ dma_addr_t baddr, bool use_prefetch)
{
+ unsigned int burst_size;
u32 val;
+ if (use_prefetch) {
+ /*
+ * address TKT343664:
+ * fetch unit base address has to align to burst size
+ */
+ burst_size = 1 << (ffs(baddr) - 1);
+ burst_size = min(burst_size, 128U);
+
+ stride = width * (bpp >> 3);
+ /*
+ * address TKT339017:
+ * fixup for burst size vs stride mismatch
+ */
+ stride = round_up(stride, burst_size);
+ }
+
mutex_lock(&fd->mutex);
val = dpu_fd_read(fd, SOURCEBUFFERATTRIBUTES0);
val &= ~0xffff;
bool use_prefetch);
void fetchdecode_baseaddress(struct dpu_fetchdecode *fd, dma_addr_t paddr);
void fetchdecode_source_bpp(struct dpu_fetchdecode *fd, int bpp);
-void fetchdecode_source_stride(struct dpu_fetchdecode *fd, int stride);
+void fetchdecode_source_stride(struct dpu_fetchdecode *fd, unsigned int width,
+ int bpp, unsigned int stride,
+ dma_addr_t baddr, bool use_prefetch);
void fetchdecode_src_buf_dimensions(struct dpu_fetchdecode *fd, unsigned int w,
unsigned int h);
void fetchdecode_set_fmt(struct dpu_fetchdecode *fd, u32 fmt);