![Icenowy Zheng](/assets/img/avatar_default.png)
As we are going to add support for the Allwinner DE2 engine in sun4i-drm driver, we will finally have two types of display engines -- the DE1 backend and the DE2 mixer. They both do some display blending and feed graphics data to TCON, and is part of the "Display Engine" called by Allwinner, so I choose to call them both "engine" here. Abstract the engine type to a new struct with an ops struct, which contains functions that should be called outside the engine-specified code (in TCON, CRTC or TV Encoder code). In order to preserve bisectability, we also switch the backend and layer code in its own module. Signed-off-by: Icenowy Zheng <icenowy@aosc.io> Reviewed-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
34 lines
880 B
C
34 lines
880 B
C
/*
|
|
* Copyright (C) 2015 Free Electrons
|
|
* Copyright (C) 2015 NextThing Co
|
|
*
|
|
* Maxime Ripard <maxime.ripard@free-electrons.com>
|
|
*
|
|
* 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 Free Software Foundation; either version 2 of
|
|
* the License, or (at your option) any later version.
|
|
*/
|
|
|
|
#ifndef _SUN4I_CRTC_H_
|
|
#define _SUN4I_CRTC_H_
|
|
|
|
struct sun4i_crtc {
|
|
struct drm_crtc crtc;
|
|
struct drm_pending_vblank_event *event;
|
|
|
|
struct sunxi_engine *engine;
|
|
struct sun4i_tcon *tcon;
|
|
};
|
|
|
|
static inline struct sun4i_crtc *drm_crtc_to_sun4i_crtc(struct drm_crtc *crtc)
|
|
{
|
|
return container_of(crtc, struct sun4i_crtc, crtc);
|
|
}
|
|
|
|
struct sun4i_crtc *sun4i_crtc_init(struct drm_device *drm,
|
|
struct sunxi_engine *engine,
|
|
struct sun4i_tcon *tcon);
|
|
|
|
#endif /* _SUN4I_CRTC_H_ */
|