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

Commit c75d9464 authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

OMAP: DSS2: move memory_read()



Move memory_read() from omap_dss_device to omap_dss_driver.

This is part of a larger patch-set, which moves the control from omapdss
driver to the display driver.

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@nokia.com>
parent 1a75ef42
Loading
Loading
Loading
Loading
+0 −4
Original line number Original line Diff line number Diff line
@@ -495,10 +495,6 @@ struct omap_dss_device {
	bool (*get_mirror)(struct omap_dss_device *dssdev);
	bool (*get_mirror)(struct omap_dss_device *dssdev);
	int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);
	int (*set_mirror)(struct omap_dss_device *dssdev, bool enable);


	int (*memory_read)(struct omap_dss_device *dssdev,
			void *buf, size_t size,
			u16 x, u16 y, u16 w, u16 h);

	int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
	int (*set_wss)(struct omap_dss_device *dssdev, u32 wss);
	u32 (*get_wss)(struct omap_dss_device *dssdev);
	u32 (*get_wss)(struct omap_dss_device *dssdev);


+10 −3
Original line number Original line Diff line number Diff line
@@ -847,6 +847,10 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
	int first = 1;
	int first = 1;
	int plen;
	int plen;
	unsigned buf_used = 0;
	unsigned buf_used = 0;
	struct taal_data *td = dev_get_drvdata(&dssdev->dev);

	if (!td->enabled)
		return -ENODEV;


	if (size < w * h * 3)
	if (size < w * h * 3)
		return -ENOMEM;
		return -ENOMEM;
@@ -855,6 +859,8 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
			dssdev->panel.timings.x_res *
			dssdev->panel.timings.x_res *
			dssdev->panel.timings.y_res * 3);
			dssdev->panel.timings.y_res * 3);


	dsi_bus_lock();

	/* plen 1 or 2 goes into short packet. until checksum error is fixed,
	/* plen 1 or 2 goes into short packet. until checksum error is fixed,
	 * use short packets. plen 32 works, but bigger packets seem to cause
	 * use short packets. plen 32 works, but bigger packets seem to cause
	 * an error. */
	 * an error. */
@@ -863,11 +869,11 @@ static int taal_memory_read(struct omap_dss_device *dssdev,
	else
	else
		plen = 2;
		plen = 2;


	taal_setup_update(dssdev, x, y, w, h);
	taal_set_update_window(x, y, w, h);


	r = dsi_vc_set_max_rx_packet_size(TCH, plen);
	r = dsi_vc_set_max_rx_packet_size(TCH, plen);
	if (r)
	if (r)
		return r;
		goto err0;


	while (buf_used < size) {
	while (buf_used < size) {
		u8 dcs_cmd = first ? 0x2e : 0x3e;
		u8 dcs_cmd = first ? 0x2e : 0x3e;
@@ -900,7 +906,8 @@ static int taal_memory_read(struct omap_dss_device *dssdev,


err:
err:
	dsi_vc_set_max_rx_packet_size(TCH, 1);
	dsi_vc_set_max_rx_packet_size(TCH, 1);

err0:
	dsi_bus_unlock();
	return r;
	return r;
}
}


+0 −30
Original line number Original line Diff line number Diff line
@@ -3584,34 +3584,6 @@ static bool dsi_display_get_mirror(struct omap_dss_device *dssdev)
	return dssdev->driver->get_mirror(dssdev);
	return dssdev->driver->get_mirror(dssdev);
}
}


static int dsi_display_memory_read(struct omap_dss_device *dssdev,
		void *buf, size_t size,
		u16 x, u16 y, u16 w, u16 h)
{
	int r;

	DSSDBGF("");

	if (!dssdev->driver->memory_read)
		return -EINVAL;

	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE)
		return -EIO;

	dsi_bus_lock();

	r = dssdev->driver->memory_read(dssdev, buf, size,
			x, y, w, h);

	/* Memory read usually changes the update area. This will
	 * force the next update to re-set the update area */
	dsi.active_update_region.dirty = true;

	dsi_bus_unlock();

	return r;
}

void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
void dsi_get_overlay_fifo_thresholds(enum omap_plane plane,
		u32 fifo_size, enum omap_burst_size *burst_size,
		u32 fifo_size, enum omap_burst_size *burst_size,
		u32 *fifo_low, u32 *fifo_high)
		u32 *fifo_low, u32 *fifo_high)
@@ -3646,8 +3618,6 @@ int dsi_init_display(struct omap_dss_device *dssdev)
	dssdev->get_mirror = dsi_display_get_mirror;
	dssdev->get_mirror = dsi_display_get_mirror;
	dssdev->set_mirror = dsi_display_set_mirror;
	dssdev->set_mirror = dsi_display_set_mirror;


	dssdev->memory_read = dsi_display_memory_read;

	/* XXX these should be figured out dynamically */
	/* XXX these should be figured out dynamically */
	dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
	dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE |
		OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
		OMAP_DSS_DISPLAY_CAP_TEAR_ELIM;
+2 −2
Original line number Original line Diff line number Diff line
@@ -374,7 +374,7 @@ static int omapfb_memory_read(struct fb_info *fbi,
	void *buf;
	void *buf;
	int r;
	int r;


	if (!display || !display->memory_read)
	if (!display || !display->driver->memory_read)
		return -ENOENT;
		return -ENOENT;


	if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size))
	if (!access_ok(VERIFY_WRITE, mr->buffer, mr->buffer_size))
@@ -389,7 +389,7 @@ static int omapfb_memory_read(struct fb_info *fbi,
		return -ENOMEM;
		return -ENOMEM;
	}
	}


	r = display->memory_read(display, buf, mr->buffer_size,
	r = display->driver->memory_read(display, buf, mr->buffer_size,
			mr->x, mr->y, mr->w, mr->h);
			mr->x, mr->y, mr->w, mr->h);


	if (r > 0) {
	if (r > 0) {