struct dpu_layerblend *lb;
struct dpu_constframe *cf;
struct dpu_extdst *ed;
- struct dpu_framegen *fg;
+ struct dpu_framegen *fg = res->fg[dplane->stream_id];
struct device *dev = plane->dev->dev;
dma_addr_t baseaddr, uv_baseaddr = 0;
dpu_block_id_t fe_id, vs_id = ID_NONE, hs_id;
int bpp, fd_id, lb_id;
bool need_fetcheco = false, need_hscaler = false, need_vscaler = false;
bool prefetch_start = false, aux_prefetch_start = false;
+ bool need_modeset;
+ bool is_overlay = plane->type == DRM_PLANE_TYPE_OVERLAY;
/*
* Do nothing since the plane is disabled by
if (!fb)
return;
+ need_modeset = drm_atomic_crtc_needs_modeset(state->crtc->state);
+
fd_id = source_to_id(dpstate->source);
if (fd_id < 0)
return;
if (dpstate->use_prefetch &&
(fetchdecode_get_stream_id(fd) == DPU_PLANE_SRC_DISABLED ||
- drm_atomic_crtc_needs_modeset(state->crtc->state)))
+ need_modeset))
prefetch_start = true;
fetchdecode_set_burstlength(fd, baseaddr, dpstate->use_prefetch);
if (dpstate->use_prefetch &&
(fetcheco_get_stream_id(fe) == DPU_PLANE_SRC_DISABLED ||
- drm_atomic_crtc_needs_modeset(state->crtc->state)))
+ need_modeset))
aux_prefetch_start = true;
fetchdecode_pixengcfg_dynamic_src_sel(fd,
fetchdecode_reg_update_prefetch(fd);
- if (prefetch_start || aux_prefetch_start)
- fetchdecode_prefetch_enable_first_frame_irq(fd);
+ if (prefetch_start || aux_prefetch_start) {
+ fetchdecode_prefetch_first_frame_handle(fd);
+
+ if (!need_modeset && is_overlay)
+ framegen_wait_for_frame_counter_moving(fg);
+ }
dev_dbg(dev, "[PLANE:%d:%s] use prefetch\n",
plane->base.id, plane->name);
dpstate->base_w, dpstate->base_h);
constframe_constantcolor(cf, 0, 0, 0, 0);
- fg = res->fg[dplane->stream_id];
framegen_sacfg(fg, dpstate->base_x, dpstate->base_y);
}
/*
* Copyright (C) 2016 Freescale Semiconductor, Inc.
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
}
EXPORT_SYMBOL_GPL(fetchdecode_reg_update_prefetch);
+void fetchdecode_prefetch_first_frame_handle(struct dpu_fetchdecode *fd)
+{
+ if (WARN_ON(!fd || !fd->dprc))
+ return;
+
+ dprc_first_frame_handle(fd->dprc);
+}
+EXPORT_SYMBOL_GPL(fetchdecode_prefetch_first_frame_handle);
+
void fetchdecode_prefetch_irq_handle(struct dpu_fetchdecode *fd)
{
if (WARN_ON(!fd || !fd->dprc))
/*
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
dprc_write(dprc, val, MODE_CTRL0);
if (start) {
- val = RUN_EN | REPEAT_EN | SHADOW_LOAD_EN;
/* software shadow load for the first frame */
- val |= SW_SHADOW_LOAD_SEL;
- dprc_write(dprc, val, SYSTEM_CTRL0);
+ val = SW_SHADOW_LOAD_SEL;
+ if (dprc->is_blit_chan) {
+ val |= RUN_EN | REPEAT_EN | SHADOW_LOAD_EN;
+ dprc_write(dprc, val, SYSTEM_CTRL0);
+ } else {
+ val |= SHADOW_LOAD_EN;
+ dprc_write(dprc, val, SYSTEM_CTRL0);
+
+ /* and then, run... */
+ val |= RUN_EN | REPEAT_EN;
+ dprc_write(dprc, val, SYSTEM_CTRL0);
+ }
}
prg_configure(dprc->prgs[0], width, height, x_offset, y_offset,
}
EXPORT_SYMBOL_GPL(dprc_reg_update);
-static void dprc_first_frame_handle(struct dprc *dprc)
+void dprc_first_frame_handle(struct dprc *dprc)
{
if (WARN_ON(!dprc))
return;
- dprc_write(dprc, SW_SHADOW_LOAD_SEL, SYSTEM_CTRL0 + CLR);
+ if (dprc->is_blit_chan)
+ dprc_write(dprc, SW_SHADOW_LOAD_SEL, SYSTEM_CTRL0 + CLR);
+ else
+ dprc_write(dprc, REPEAT_EN, SYSTEM_CTRL0);
prg_shadow_enable(dprc->prgs[0]);
if (dprc->use_aux_prg)
prg_shadow_enable(dprc->prgs[1]);
}
+EXPORT_SYMBOL_GPL(dprc_first_frame_handle);
void dprc_irq_handle(struct dprc *dprc)
{
void fetchdecode_enable_prefetch(struct dpu_fetchdecode *fd);
void fetchdecode_disable_prefetch(struct dpu_fetchdecode *fd);
void fetchdecode_reg_update_prefetch(struct dpu_fetchdecode *fd);
+void fetchdecode_prefetch_first_frame_handle(struct dpu_fetchdecode *fd);
void fetchdecode_prefetch_irq_handle(struct dpu_fetchdecode *fd);
void fetchdecode_prefetch_enable_first_frame_irq(struct dpu_fetchdecode *fd);
bool fetchdecode_has_prefetch(struct dpu_fetchdecode *fd);
/*
- * Copyright 2017 NXP
+ * Copyright 2017-2018 NXP
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
unsigned long baddr, unsigned long uv_baddr,
bool start, bool aux_start);
void dprc_reg_update(struct dprc *dprc);
+void dprc_first_frame_handle(struct dprc *dprc);
void dprc_irq_handle(struct dprc *dprc);
void dprc_enable_ctrl_done_irq(struct dprc *dprc);
bool dprc_format_supported(struct dprc *dprc, u32 format, u64 modifier);