Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c0ae5a9 authored by Kyle Yan's avatar Kyle Yan Committed by Gerrit - the friendly Code Review server
Browse files

Merge "drm/msm/sde: remove static allocation of mdp_top hw block" into msm-4.8

parents a05bdf16 85ef3fe9
Loading
Loading
Loading
Loading
+10 −13
Original line number Diff line number Diff line
@@ -141,34 +141,31 @@ struct sde_hw_mdp *sde_hw_mdptop_init(enum sde_mdp idx,
		void __iomem *addr,
		const struct sde_mdss_cfg *m)
{
	static struct sde_hw_mdp *c;
	struct sde_hw_mdp *mdp;
	const struct sde_mdp_cfg *cfg;

	/* mdp top is singleton */
	if (c)
		return c;

	c = kzalloc(sizeof(*c), GFP_KERNEL);
	if (!c)
	mdp = kzalloc(sizeof(*mdp), GFP_KERNEL);
	if (!mdp)
		return ERR_PTR(-ENOMEM);

	cfg = _top_offset(idx, m, addr, &c->hw);
	cfg = _top_offset(idx, m, addr, &mdp->hw);
	if (IS_ERR_OR_NULL(cfg)) {
		kfree(c);
		kfree(mdp);
		return ERR_PTR(-EINVAL);
	}

	/*
	 * Assign ops
	 */
	c->idx = idx;
	c->cap = cfg;
	_setup_mdp_ops(&c->ops, c->cap->features);
	mdp->idx = idx;
	mdp->cap = cfg;
	_setup_mdp_ops(&mdp->ops, mdp->cap->features);

	/*
	 * Perform any default initialization for the intf
	 */
	return c;

	return mdp;
}

void sde_hw_mdp_destroy(struct sde_hw_mdp *mdp)