/* * DOC: Driver for the ARM FrameBuffer Compression Decoders * * The Amlogic GXM and G12A SoC families embeds an AFBC Decoder, * to decode compressed buffers generated by the ARM Mali GPU. * * For the GXM Family, Amlogic designed their own Decoder, named in * the vendor source as "MESON_AFBC", and a single decoder is available * for the 2 OSD planes. * This decoder is compatible with the AFBC 1.0 specifications and the * Mali T820 GPU capabilities. * It supports : * - basic AFBC buffer for RGB32 only, thus YTR feature is mandatory * - SPARSE layout and SPLIT layout * - only 16x16 superblock * * The decoder reads the data from the SDRAM, decodes and sends the * decoded pixel stream to the OSD1 Plane pixel composer. * * For the G12A Family, Amlogic integrated an ARM AFBC Decoder, named * in the vendor source as "MALI_AFBC", and the decoder can decode up * to 4 surfaces, one for each of the 4 available OSDs. * This decoder is compatible with the AFBC 1.2 specifications for the * Mali G31 and G52 GPUs. * Is supports : * - basic AFBC buffer for multiple RGB and YUV pixel formats * - SPARSE layout and SPLIT layout * - 16x16 and 32x8 "wideblk" superblocks * - Tiled header * * The ARM AFBC Decoder independent from the VPU Pixel Pipeline, so * the ARM AFBC Decoder reads the data from the SDRAM then decodes * into a private internal physical address where the OSD1 Plane pixel * composer unpacks the decoded data.
*/
/* Amlogic AFBC Decoder for GXM Family */
#define OSD1_AFBCD_RGB32 0x15
staticint meson_gxm_afbcd_pixel_fmt(u64 modifier, uint32_t format)
{ switch (format) { case DRM_FORMAT_XBGR8888: case DRM_FORMAT_ABGR8888: return OSD1_AFBCD_RGB32; /* TOFIX support mode formats */ default:
DRM_DEBUG("unsupported afbc format[%08x]\n", format); return -EINVAL;
}
}
staticint meson_g12a_afbcd_pixel_fmt(u64 modifier, uint32_t format)
{ switch (format) { case DRM_FORMAT_XRGB8888: case DRM_FORMAT_ARGB8888: /* YTR is forbidden for non XBGR formats */ if (modifier & AFBC_FORMAT_MOD_YTR) return -EINVAL;
fallthrough; case DRM_FORMAT_XBGR8888: case DRM_FORMAT_ABGR8888: return MAFBC_FMT_RGBA8888; case DRM_FORMAT_RGB888: /* YTR is forbidden for non XBGR formats */ if (modifier & AFBC_FORMAT_MOD_YTR) return -EINVAL; return MAFBC_FMT_RGB888; case DRM_FORMAT_RGB565: /* YTR is forbidden for non XBGR formats */ if (modifier & AFBC_FORMAT_MOD_YTR) return -EINVAL; return MAFBC_FMT_RGB565; /* TOFIX support mode formats */ default:
DRM_DEBUG("unsupported afbc format[%08x]\n", format); return -EINVAL;
}
}
staticint meson_g12a_afbcd_bpp(uint32_t format)
{ switch (format) { case DRM_FORMAT_XRGB8888: case DRM_FORMAT_ARGB8888: case DRM_FORMAT_XBGR8888: case DRM_FORMAT_ABGR8888: return 32; case DRM_FORMAT_RGB888: return 24; case DRM_FORMAT_RGB565: return 16; /* TOFIX support mode formats */ default:
DRM_ERROR("unsupported afbc format[%08x]\n", format); return 0;
}
}
staticint meson_g12a_afbcd_fmt_to_blk_mode(u64 modifier, uint32_t format)
{ switch (format) { case DRM_FORMAT_XRGB8888: case DRM_FORMAT_ARGB8888: case DRM_FORMAT_XBGR8888: case DRM_FORMAT_ABGR8888: return OSD_MALI_COLOR_MODE_RGBA8888; case DRM_FORMAT_RGB888: return OSD_MALI_COLOR_MODE_RGB888; case DRM_FORMAT_RGB565: return OSD_MALI_COLOR_MODE_RGB565; /* TOFIX support mode formats */ default:
DRM_DEBUG("unsupported afbc format[%08x]\n", format); return -EINVAL;
}
}
staticint meson_g12a_afbcd_setup(struct meson_drm *priv)
{
u32 format = meson_g12a_afbcd_pixel_fmt(priv->afbcd.modifier,
priv->afbcd.format);
if (priv->afbcd.modifier & AFBC_FORMAT_MOD_YTR)
format |= VPU_MAFBC_YUV_TRANSFORM;
if (priv->afbcd.modifier & AFBC_FORMAT_MOD_SPLIT)
format |= VPU_MAFBC_BLOCK_SPLIT;
if (priv->afbcd.modifier & AFBC_FORMAT_MOD_TILED)
format |= VPU_MAFBC_TILED_HEADER_EN;
if ((priv->afbcd.modifier & AFBC_FORMAT_MOD_BLOCK_SIZE_MASK) ==
AFBC_FORMAT_MOD_BLOCK_SIZE_32x8)
format |= FIELD_PREP(VPU_MAFBC_SUPER_BLOCK_ASPECT, 1);
meson_rdma_writel_sync(priv, format,
VPU_MAFBC_FORMAT_SPECIFIER_S0);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.