bool is_cvbs;
} meson_fb = { 0 };
+
+static struct display_timing default_timing_1920x1080 = {
+ .pixelclock = { .typ = 148500000 },
+ .hactive = { .typ = 1920 },
+ .hfront_porch = { .typ = 88 },
+ .hback_porch = { .typ = 148 },
+ .hsync_len = { .typ = 44 },
+ .vactive = { .typ = 1080 },
+ .vfront_porch = { .typ = 4 },
+ .vback_porch = { .typ = 36 },
+ .vsync_len = { .typ = 5 },
+ .flags = DISPLAY_FLAGS_DE_LOW,
+};
+
bool meson_vpu_is_compatible(struct meson_vpu_priv *priv,
enum vpu_compatible family)
{
{
struct video_uc_plat *uc_plat = dev_get_uclass_plat(dev);
struct video_priv *uc_priv = dev_get_uclass_priv(dev);
- struct display_timing timing;
+ struct display_timing disp_timing;
+ struct display_timing *timing = &disp_timing;
bool is_cvbs = false;
int ret = 0;
if (disp) {
- ret = display_read_timing(disp, &timing);
+ ret = display_read_timing(disp, timing);
if (ret) {
- debug("%s: Failed to read timings\n", __func__);
- goto cvbs;
+ char *env;
+
+ printf("%s: Unsupported display timings\n", __func__);
+
+ env = env_get("hdmimode");
+ if (!env || strcmp(env, "1080p60hz"))
+ goto cvbs;
+
+ printf("%s: Using default full HD timings\n", __func__);
+
+ timing = &default_timing_1920x1080;
}
- uc_priv->xsize = timing.hactive.typ;
- uc_priv->ysize = timing.vactive.typ;
+ uc_priv->xsize = timing->hactive.typ;
+ uc_priv->ysize = timing->vactive.typ;
- ret = display_enable(disp, 0, &timing);
+ ret = display_enable(disp, 0, timing);
if (ret)
goto cvbs;
} else {
cvbs:
/* CVBS has a fixed 720x480i (NTSC) and 720x576i (PAL) */
is_cvbs = true;
- timing.flags = DISPLAY_FLAGS_INTERLACED;
+ timing->flags = DISPLAY_FLAGS_INTERLACED;
uc_priv->xsize = 720;
uc_priv->ysize = 576;
}
/* Override the framebuffer address */
uc_plat->base = meson_fb.base;
- meson_vpu_setup_plane(dev, timing.flags & DISPLAY_FLAGS_INTERLACED);
- meson_vpu_setup_venc(dev, &timing, is_cvbs);
- meson_vpu_setup_vclk(dev, &timing, is_cvbs);
+ meson_vpu_setup_plane(dev, timing->flags & DISPLAY_FLAGS_INTERLACED);
+ meson_vpu_setup_venc(dev, timing, is_cvbs);
+ meson_vpu_setup_vclk(dev, timing, is_cvbs);
video_set_flush_dcache(dev, 1);