mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/chenhuacai/linux-loongson
synced 2025-09-02 08:32:55 +00:00

i.MX8qxp Display Controller(DC) is comprised of three main components that include a blit engine for 2D graphics accelerations, display controller for display output processing, as well as a command sequencer. Add kernel mode setting support for the display controller part with two CRTCs and two primary planes(backed by FetchLayer and FetchWarp respectively). The registers of the display controller are accessed without command sequencer involved, instead just by using CPU. The command sequencer is supposed to be used by the blit engine. Reviewed-by: Maxime Ripard <mripard@kernel.org> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Signed-off-by: Liu Ying <victor.liu@nxp.com> Link: https://lore.kernel.org/r/20250414035028.1561475-13-victor.liu@nxp.com
60 lines
1.5 KiB
C
60 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
/*
|
|
* Copyright 2024 NXP
|
|
*/
|
|
|
|
#ifndef __DC_DISPLAY_ENGINE_H__
|
|
#define __DC_DISPLAY_ENGINE_H__
|
|
|
|
#include <linux/clk.h>
|
|
#include <linux/device.h>
|
|
#include <linux/regmap.h>
|
|
#include <drm/drm_modes.h>
|
|
|
|
#define DC_DISPLAYS 2
|
|
|
|
#define DC_FRAMEGEN_MAX_FRAME_INDEX 0x3ffff
|
|
#define DC_FRAMEGEN_MAX_CLOCK_KHZ 300000
|
|
|
|
struct dc_fg {
|
|
struct device *dev;
|
|
struct regmap *reg;
|
|
struct clk *clk_disp;
|
|
};
|
|
|
|
struct dc_tc {
|
|
struct device *dev;
|
|
struct regmap *reg;
|
|
};
|
|
|
|
struct dc_de {
|
|
struct device *dev;
|
|
struct regmap *reg_top;
|
|
struct dc_fg *fg;
|
|
struct dc_tc *tc;
|
|
int irq_shdload;
|
|
int irq_framecomplete;
|
|
int irq_seqcomplete;
|
|
};
|
|
|
|
/* Frame Generator Unit */
|
|
void dc_fg_cfg_videomode(struct dc_fg *fg, struct drm_display_mode *m);
|
|
void dc_fg_enable(struct dc_fg *fg);
|
|
void dc_fg_disable(struct dc_fg *fg);
|
|
void dc_fg_shdtokgen(struct dc_fg *fg);
|
|
u32 dc_fg_get_frame_index(struct dc_fg *fg);
|
|
u32 dc_fg_get_line_index(struct dc_fg *fg);
|
|
bool dc_fg_wait_for_frame_index_moving(struct dc_fg *fg);
|
|
bool dc_fg_secondary_requests_to_read_empty_fifo(struct dc_fg *fg);
|
|
void dc_fg_secondary_clear_channel_status(struct dc_fg *fg);
|
|
int dc_fg_wait_for_secondary_syncup(struct dc_fg *fg);
|
|
void dc_fg_enable_clock(struct dc_fg *fg);
|
|
void dc_fg_disable_clock(struct dc_fg *fg);
|
|
enum drm_mode_status dc_fg_check_clock(struct dc_fg *fg, int clk_khz);
|
|
void dc_fg_init(struct dc_fg *fg);
|
|
|
|
/* Timing Controller Unit */
|
|
void dc_tc_init(struct dc_tc *tc);
|
|
|
|
#endif /* __DC_DISPLAY_ENGINE_H__ */
|