h = drm_rect_height(&plane_state->dst);
DRM_DEBUG_DRIVER(" plane %d: chan=%d ovl=%d en=%d zpos=%d x=%d y=%d w=%d h=%d\n",
- plane->base.id, layer->channel, layer->overlay,
+ plane->base.id, layer->index, layer->overlay,
enable, zpos, x, y, w, h);
if (!enable)
continue;
/* Route layer to pipe based on zpos */
- route |= layer->channel << SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT(zpos);
+ route |= layer->index << SUN8I_MIXER_BLEND_ROUTE_PIPE_SHIFT(zpos);
pipe_en |= SUN8I_MIXER_BLEND_PIPE_CTL_EN(zpos);
regmap_write(bld_regs,
struct sun8i_mixer *mixer = engine_to_sun8i_mixer(engine);
int plane_cnt = mixer->cfg->ui_num + mixer->cfg->vi_num;
enum drm_plane_type type;
+ unsigned int phy_index;
int i;
planes = devm_kcalloc(drm->dev, plane_cnt, sizeof(*planes), GFP_KERNEL);
else
type = DRM_PLANE_TYPE_OVERLAY;
+ phy_index = i;
+ if (mixer->cfg->de_type == SUN8I_MIXER_DE33)
+ phy_index = mixer->cfg->map[i];
+
layer = sun8i_vi_layer_init_one(drm, mixer, type,
mixer->engine.regs, i,
- plane_cnt);
+ phy_index, plane_cnt);
if (IS_ERR(layer)) {
dev_err(drm->dev,
"Couldn't initialize overlay plane\n");
else
type = DRM_PLANE_TYPE_OVERLAY;
+ phy_index = index;
+ if (mixer->cfg->de_type == SUN8I_MIXER_DE33)
+ phy_index = mixer->cfg->map[index];
+
layer = sun8i_ui_layer_init_one(drm, mixer, type,
mixer->engine.regs, index,
- plane_cnt);
+ phy_index, plane_cnt);
if (IS_ERR(layer)) {
dev_err(drm->dev, "Couldn't initialize %s plane\n",
i ? "overlay" : "primary");
struct drm_plane plane;
struct sun8i_mixer *mixer;
int type;
+ int index;
int channel;
int overlay;
struct regmap *regs;
sun8i_channel_base(struct sun8i_mixer *mixer, int channel)
{
if (mixer->cfg->de_type == SUN8I_MIXER_DE33)
- return DE33_CH_BASE + mixer->cfg->map[channel] * DE33_CH_SIZE;
+ return DE33_CH_BASE + channel * DE33_CH_SIZE;
else if (mixer->cfg->de_type == SUN8I_MIXER_DE3)
return DE3_CH_BASE + channel * DE3_CH_SIZE;
else
struct sun8i_mixer *mixer,
enum drm_plane_type type,
struct regmap *regs,
- int index,
+ int index, int phy_index,
int plane_cnt)
{
struct sun8i_layer *layer;
layer->mixer = mixer;
layer->type = SUN8I_LAYER_TYPE_UI;
- layer->channel = index;
+ layer->index = index;
+ layer->channel = phy_index;
layer->overlay = 0;
layer->regs = regs;
struct sun8i_mixer *mixer,
enum drm_plane_type type,
struct regmap *regs,
- int index,
+ int index, int phy_index,
int plane_cnt)
{
u32 supported_encodings, supported_ranges;
layer->mixer = mixer;
layer->type = SUN8I_LAYER_TYPE_VI;
- layer->channel = index;
+ layer->index = index;
+ layer->channel = phy_index;
layer->overlay = 0;
layer->regs = regs;