@@ -51,6 +51,19 @@ static void sun50i_fmt_de3_limits(u32 *limits, u32 colorspace, bool bit10)
}
}
+static void sun50i_fmt_de33_limits(u32 *limits, u32 colorspace)
+{
+ if (colorspace == SUN50I_FMT_CS_YUV444RGB) {
+ limits[0] = SUN50I_FMT_LIMIT(0, 4095);
+ limits[1] = SUN50I_FMT_LIMIT(0, 4095);
+ limits[2] = SUN50I_FMT_LIMIT(0, 4095);
+ } else {
+ limits[0] = SUN50I_FMT_LIMIT(256, 3840);
+ limits[1] = SUN50I_FMT_LIMIT(256, 3840);
+ limits[2] = SUN50I_FMT_LIMIT(256, 3840);
+ }
+}
+
void sun50i_fmt_setup(struct sun8i_mixer *mixer, u16 width,
u16 height, u32 format)
{
@@ -60,10 +73,14 @@ void sun50i_fmt_setup(struct sun8i_mixer *mixer, u16 width,
colorspace = sun50i_fmt_get_colorspace(format);
bit10 = sun50i_fmt_is_10bit(format);
- base = SUN50I_FMT_DE3;
+ base = mixer->cfg->de_type == sun8i_mixer_de3 ?
+ SUN50I_FMT_DE3 : SUN50I_FMT_DE33;
regs = sun8i_blender_regmap(mixer);
- sun50i_fmt_de3_limits(limit, colorspace, bit10);
+ if (mixer->cfg->de_type == sun8i_mixer_de3)
+ sun50i_fmt_de3_limits(limit, colorspace, bit10);
+ else
+ sun50i_fmt_de33_limits(limit, colorspace);
regmap_write(regs, SUN50I_FMT_CTRL(base), 0);
@@ -9,6 +9,7 @@
#include "sun8i_mixer.h"
#define SUN50I_FMT_DE3 0xa8000
+#define SUN50I_FMT_DE33 0x5000
#define SUN50I_FMT_CTRL(base) ((base) + 0x00)
#define SUN50I_FMT_SIZE(base) ((base) + 0x04)