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

Commit 50638ae5 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Tomi Valkeinen
Browse files

drm: omapdrm: dispc: Pass DISPC pointer to dispc_ops operations



This removes the need to access the global DISPC private data in those
functions (both for the current accesses and the future ones that will
be introduced when allocating the DISPC private data dynamically).

In order to allow the omapdrm side to call the dispc_ops with a DISPC
pointer, we also introduce a new function dss_get_dispc() to retrieve
the DISPC corresponding to the DSS.

Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: default avatarSebastian Reichel <sebastian.reichel@collabora.co.uk>
parent d3541ca8
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -44,6 +44,12 @@ void omapdss_set_dss(struct dss_device *dss)
}
EXPORT_SYMBOL(omapdss_set_dss);

struct dispc_device *dispc_get_dispc(struct dss_device *dss)
{
	return dss->dispc;
}
EXPORT_SYMBOL(dispc_get_dispc);

const struct dispc_ops *dispc_get_ops(struct dss_device *dss)
{
	return dss->dispc_ops;
+121 −102

File changed.

Preview size limit exceeded, changes collapsed.

+3 −3
Original line number Diff line number Diff line
@@ -406,7 +406,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
			goto err_reg_enable;
	}

	r = dispc_runtime_get();
	r = dispc_runtime_get(dpi->dss->dispc);
	if (r)
		goto err_get_dispc;

@@ -442,7 +442,7 @@ static int dpi_display_enable(struct omap_dss_device *dssdev)
		dss_pll_disable(dpi->pll);
err_pll_init:
err_src_sel:
	dispc_runtime_put();
	dispc_runtime_put(dpi->dss->dispc);
err_get_dispc:
	if (dpi->vdds_dsi_reg)
		regulator_disable(dpi->vdds_dsi_reg);
@@ -466,7 +466,7 @@ static void dpi_display_disable(struct omap_dss_device *dssdev)
		dss_pll_disable(dpi->pll);
	}

	dispc_runtime_put();
	dispc_runtime_put(dpi->dss->dispc);

	if (dpi->vdds_dsi_reg)
		regulator_disable(dpi->vdds_dsi_reg);
+2 −2
Original line number Diff line number Diff line
@@ -5523,7 +5523,7 @@ static int dsi_runtime_suspend(struct device *dev)
	/* wait for current handler to finish before turning the DSI off */
	synchronize_irq(dsi->irq);

	dispc_runtime_put();
	dispc_runtime_put(dsi->dss->dispc);

	return 0;
}
@@ -5533,7 +5533,7 @@ static int dsi_runtime_resume(struct device *dev)
	struct dsi_data *dsi = dev_get_drvdata(dev);
	int r;

	r = dispc_runtime_get();
	r = dispc_runtime_get(dsi->dss->dispc);
	if (r)
		return r;

+4 −2
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@

#include "omapdss.h"

struct dispc_device;
struct dss_debugfs_entry;
struct platform_device;
struct seq_file;
@@ -272,6 +273,7 @@ struct dss_device {
	struct dss_pll	*video1_pll;
	struct dss_pll	*video2_pll;

	struct dispc_device *dispc;
	const struct dispc_ops *dispc_ops;
};

@@ -407,8 +409,8 @@ static inline void dpi_uninit_port(struct device_node *port)
/* DISPC */
void dispc_dump_clocks(struct seq_file *s);

int dispc_runtime_get(void);
void dispc_runtime_put(void);
int dispc_runtime_get(struct dispc_device *dispc);
void dispc_runtime_put(struct dispc_device *dispc);

void dispc_enable_sidle(void);
void dispc_disable_sidle(void);
Loading