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

Commit 67a0375f authored by Dave Airlie's avatar Dave Airlie
Browse files

Merge tag 'omapdrm-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next

omapdrm changes for 4.1

* universal plane support
* refactoring to prepare work atomic modesetting work
* a lot of small fixes

* tag 'omapdrm-4.1' of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux: (36 commits)
  drm/omap: tiler: add hibernation callback
  drm/omap: add hibernation callbacks
  drm/omap: keep ref to old_fb
  drm/omap: fix race conditon in DMM
  drm/omap: fix race condition with dev->obj_list
  drm/omap: do not use BUG_ON(!spin_is_locked(x))
  drm/omap: only ignore DIGIT SYNC LOST for TV output
  drm/omap: fix race with error_irq
  drm/omap: use DRM_ERROR_RATELIMITED() for error irqs
  drm/omap: stop connector polling during suspend
  drm/omap: remove dummy PM functions
  drm/omap: tiler: fix race condition with engine->async
  drm/omap: fix plane's channel selection
  drm/omap: fix TILER on OMAP5
  drm/omap: handle incompatible buffer stride and pixel size
  drm/omap: fix error handling in omap_framebuffer_create()
  drm/omap: fix operation without fbdev
  drm/omap: add a comment why locking is missing
  drm/omap: add pin refcounting to omap_framebuffer
  drm/omap: clear omap_obj->paddr in omap_gem_put_paddr()
  ...
parents 4d0982c6 1d601da2
Loading
Loading
Loading
Loading
+0 −12
Original line number Original line Diff line number Diff line
@@ -271,18 +271,6 @@ static const struct drm_connector_helper_funcs omap_connector_helper_funcs = {
	.best_encoder = omap_connector_attached_encoder,
	.best_encoder = omap_connector_attached_encoder,
};
};


/* flush an area of the framebuffer (in case of manual update display that
 * is not automatically flushed)
 */
void omap_connector_flush(struct drm_connector *connector,
		int x, int y, int w, int h)
{
	struct omap_connector *omap_connector = to_omap_connector(connector);

	/* TODO: enable when supported in dss */
	VERB("%s: %d,%d, %dx%d", omap_connector->dssdev->name, x, y, w, h);
}

/* initialize connector */
/* initialize connector */
struct drm_connector *omap_connector_init(struct drm_device *dev,
struct drm_connector *omap_connector_init(struct drm_device *dev,
		int connector_type, struct omap_dss_device *dssdev,
		int connector_type, struct omap_dss_device *dssdev,
+320 −302

File changed.

Preview size limit exceeded, changes collapsed.

+7 −1
Original line number Original line Diff line number Diff line
@@ -148,11 +148,15 @@ struct refill_engine {


	bool async;
	bool async;


	wait_queue_head_t wait_for_refill;
	struct completion compl;


	struct list_head idle_node;
	struct list_head idle_node;
};
};


struct dmm_platform_data {
	uint32_t cpu_cache_flags;
};

struct dmm {
struct dmm {
	struct device *dev;
	struct device *dev;
	void __iomem *base;
	void __iomem *base;
@@ -183,6 +187,8 @@ struct dmm {


	/* allocation list and lock */
	/* allocation list and lock */
	struct list_head alloc_head;
	struct list_head alloc_head;

	const struct dmm_platform_data *plat_data;
};
};


#endif
#endif
+57 −23
Original line number Original line Diff line number Diff line
@@ -29,6 +29,7 @@
#include <linux/mm.h>
#include <linux/mm.h>
#include <linux/time.h>
#include <linux/time.h>
#include <linux/list.h>
#include <linux/list.h>
#include <linux/completion.h>


#include "omap_dmm_tiler.h"
#include "omap_dmm_tiler.h"
#include "omap_dmm_priv.h"
#include "omap_dmm_priv.h"
@@ -39,6 +40,10 @@
static struct tcm *containers[TILFMT_NFORMATS];
static struct tcm *containers[TILFMT_NFORMATS];
static struct dmm *omap_dmm;
static struct dmm *omap_dmm;


#if defined(CONFIG_OF)
static const struct of_device_id dmm_of_match[];
#endif

/* global spinlock for protecting lists */
/* global spinlock for protecting lists */
static DEFINE_SPINLOCK(list_lock);
static DEFINE_SPINLOCK(list_lock);


@@ -142,10 +147,10 @@ static irqreturn_t omap_dmm_irq_handler(int irq, void *arg)


	for (i = 0; i < dmm->num_engines; i++) {
	for (i = 0; i < dmm->num_engines; i++) {
		if (status & DMM_IRQSTAT_LST) {
		if (status & DMM_IRQSTAT_LST) {
			wake_up_interruptible(&dmm->engines[i].wait_for_refill);

			if (dmm->engines[i].async)
			if (dmm->engines[i].async)
				release_engine(&dmm->engines[i]);
				release_engine(&dmm->engines[i]);

			complete(&dmm->engines[i].compl);
		}
		}


		status >>= 8;
		status >>= 8;
@@ -269,15 +274,17 @@ static int dmm_txn_commit(struct dmm_txn *txn, bool wait)


	/* mark whether it is async to denote list management in IRQ handler */
	/* mark whether it is async to denote list management in IRQ handler */
	engine->async = wait ? false : true;
	engine->async = wait ? false : true;
	reinit_completion(&engine->compl);
	/* verify that the irq handler sees the 'async' and completion value */
	smp_mb();


	/* kick reload */
	/* kick reload */
	writel(engine->refill_pa,
	writel(engine->refill_pa,
		dmm->base + reg[PAT_DESCR][engine->id]);
		dmm->base + reg[PAT_DESCR][engine->id]);


	if (wait) {
	if (wait) {
		if (wait_event_interruptible_timeout(engine->wait_for_refill,
		if (!wait_for_completion_timeout(&engine->compl,
				wait_status(engine, DMM_PATSTATUS_READY) == 0,
				msecs_to_jiffies(1))) {
				msecs_to_jiffies(1)) <= 0) {
			dev_err(dmm->dev, "timed out waiting for done\n");
			dev_err(dmm->dev, "timed out waiting for done\n");
			ret = -ETIMEDOUT;
			ret = -ETIMEDOUT;
		}
		}
@@ -529,6 +536,11 @@ size_t tiler_vsize(enum tiler_fmt fmt, uint16_t w, uint16_t h)
	return round_up(geom[fmt].cpp * w, PAGE_SIZE) * h;
	return round_up(geom[fmt].cpp * w, PAGE_SIZE) * h;
}
}


uint32_t tiler_get_cpu_cache_flags(void)
{
	return omap_dmm->plat_data->cpu_cache_flags;
}

bool dmm_is_available(void)
bool dmm_is_available(void)
{
{
	return omap_dmm ? true : false;
	return omap_dmm ? true : false;
@@ -592,6 +604,18 @@ static int omap_dmm_probe(struct platform_device *dev)


	init_waitqueue_head(&omap_dmm->engine_queue);
	init_waitqueue_head(&omap_dmm->engine_queue);


	if (dev->dev.of_node) {
		const struct of_device_id *match;

		match = of_match_node(dmm_of_match, dev->dev.of_node);
		if (!match) {
			dev_err(&dev->dev, "failed to find matching device node\n");
			return -ENODEV;
		}

		omap_dmm->plat_data = match->data;
	}

	/* lookup hwmod data - base address and irq */
	/* lookup hwmod data - base address and irq */
	mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
	mem = platform_get_resource(dev, IORESOURCE_MEM, 0);
	if (!mem) {
	if (!mem) {
@@ -696,7 +720,7 @@ static int omap_dmm_probe(struct platform_device *dev)
						(REFILL_BUFFER_SIZE * i);
						(REFILL_BUFFER_SIZE * i);
		omap_dmm->engines[i].refill_pa = omap_dmm->refill_pa +
		omap_dmm->engines[i].refill_pa = omap_dmm->refill_pa +
						(REFILL_BUFFER_SIZE * i);
						(REFILL_BUFFER_SIZE * i);
		init_waitqueue_head(&omap_dmm->engines[i].wait_for_refill);
		init_completion(&omap_dmm->engines[i].compl);


		list_add(&omap_dmm->engines[i].idle_node, &omap_dmm->idle_head);
		list_add(&omap_dmm->engines[i].idle_node, &omap_dmm->idle_head);
	}
	}
@@ -941,7 +965,7 @@ int tiler_map_show(struct seq_file *s, void *arg)
}
}
#endif
#endif


#ifdef CONFIG_PM
#ifdef CONFIG_PM_SLEEP
static int omap_dmm_resume(struct device *dev)
static int omap_dmm_resume(struct device *dev)
{
{
	struct tcm_area area;
	struct tcm_area area;
@@ -965,16 +989,28 @@ static int omap_dmm_resume(struct device *dev)


	return 0;
	return 0;
}
}

static const struct dev_pm_ops omap_dmm_pm_ops = {
	.resume = omap_dmm_resume,
};
#endif
#endif


static SIMPLE_DEV_PM_OPS(omap_dmm_pm_ops, NULL, omap_dmm_resume);

#if defined(CONFIG_OF)
#if defined(CONFIG_OF)
static const struct dmm_platform_data dmm_omap4_platform_data = {
	.cpu_cache_flags = OMAP_BO_WC,
};

static const struct dmm_platform_data dmm_omap5_platform_data = {
	.cpu_cache_flags = OMAP_BO_UNCACHED,
};

static const struct of_device_id dmm_of_match[] = {
static const struct of_device_id dmm_of_match[] = {
	{ .compatible = "ti,omap4-dmm", },
	{
	{ .compatible = "ti,omap5-dmm", },
		.compatible = "ti,omap4-dmm",
		.data = &dmm_omap4_platform_data,
	},
	{
		.compatible = "ti,omap5-dmm",
		.data = &dmm_omap5_platform_data,
	},
	{},
	{},
};
};
#endif
#endif
@@ -986,9 +1022,7 @@ struct platform_driver omap_dmm_driver = {
		.owner = THIS_MODULE,
		.owner = THIS_MODULE,
		.name = DMM_DRIVER_NAME,
		.name = DMM_DRIVER_NAME,
		.of_match_table = of_match_ptr(dmm_of_match),
		.of_match_table = of_match_ptr(dmm_of_match),
#ifdef CONFIG_PM
		.pm = &omap_dmm_pm_ops,
		.pm = &omap_dmm_pm_ops,
#endif
	},
	},
};
};


+1 −0
Original line number Original line Diff line number Diff line
@@ -106,6 +106,7 @@ uint32_t tiler_stride(enum tiler_fmt fmt, uint32_t orient);
size_t tiler_size(enum tiler_fmt fmt, uint16_t w, uint16_t h);
size_t tiler_size(enum tiler_fmt fmt, uint16_t w, uint16_t h);
size_t tiler_vsize(enum tiler_fmt fmt, uint16_t w, uint16_t h);
size_t tiler_vsize(enum tiler_fmt fmt, uint16_t w, uint16_t h);
void tiler_align(enum tiler_fmt fmt, uint16_t *w, uint16_t *h);
void tiler_align(enum tiler_fmt fmt, uint16_t *w, uint16_t *h);
uint32_t tiler_get_cpu_cache_flags(void);
bool dmm_is_available(void);
bool dmm_is_available(void);


extern struct platform_driver omap_dmm_driver;
extern struct platform_driver omap_dmm_driver;
Loading