aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLajos Molnar <lajos@ti.com>2012-03-15 21:38:57 -0500
committerZiyann <jaraidaniel@gmail.com>2014-11-19 21:10:38 +0100
commit0ea32000f26258e12fda2b278d4a8edebaf2e295 (patch)
treee180266f426c578e159f43cd587c6801532837c6
parent5ca8a84a20463793775eb84cb2da8c3871824eb3 (diff)
downloadkernel_samsung_tuna-0ea32000f26258e12fda2b278d4a8edebaf2e295.zip
kernel_samsung_tuna-0ea32000f26258e12fda2b278d4a8edebaf2e295.tar.gz
kernel_samsung_tuna-0ea32000f26258e12fda2b278d4a8edebaf2e295.tar.bz2
OMAPDSS: DSSCOMP: Added platform_info and getter
Get platform information from dss2 driver and android_display, instead of it being hardcoded in dsscomp clients. Change-Id: Icc23245ec93d93dd0d9b9fcd791e546720699dcc Signed-off-by: Lajos Molnar <lajos@ti.com> Signed-off-by: Dima Svetlov <svetlov@ti.com>
-rw-r--r--drivers/video/omap2/dsscomp/device.c41
-rw-r--r--drivers/video/omap2/dsscomp/dsscomp.h7
-rw-r--r--drivers/video/omap2/dsscomp/gralloc.c14
-rw-r--r--include/video/dsscomp.h41
4 files changed, 91 insertions, 12 deletions
diff --git a/drivers/video/omap2/dsscomp/device.c b/drivers/video/omap2/dsscomp/device.c
index 53a81bb..b68abfd 100644
--- a/drivers/video/omap2/dsscomp/device.c
+++ b/drivers/video/omap2/dsscomp/device.c
@@ -39,14 +39,19 @@
#include <video/omapdss.h>
#include <video/dsscomp.h>
+#include <plat/android-display.h>
#include <plat/dsscomp.h>
#include "dsscomp.h"
+#include "../dss/dss_features.h"
+#include "../dss/dss.h"
#include <linux/debugfs.h>
static DECLARE_WAIT_QUEUE_HEAD(waitq);
static DEFINE_MUTEX(wait_mtx);
+static struct dsscomp_platform_info platform_info;
+
static u32 hwc_virt_to_phys(u32 arg)
{
pmd_t *pmd;
@@ -353,7 +358,7 @@ static long query_display(struct dsscomp_dev *cdev,
static long check_ovl(struct dsscomp_dev *cdev,
struct dsscomp_check_ovl_data *chk)
{
- /* for now return all overlays as possible */
+ /* for now return all overlays as possstruct dsscomp_dev *cdevible */
return (1 << cdev->num_ovls) - 1;
}
@@ -413,6 +418,32 @@ static void fill_cache(struct dsscomp_dev *cdev)
cdev->wb_ovl ? 1 : 0);
}
+static void fill_platform_info(struct dsscomp_dev *cdev)
+{
+ struct dsscomp_platform_info *p = &platform_info;
+
+ p->max_xdecim_1d = 16;
+ p->max_xdecim_2d = 16;
+ p->max_ydecim_1d = 16;
+ p->max_ydecim_2d = 2;
+
+ p->fclk = dss_feat_get_param_max(FEAT_PARAM_DSS_FCK);
+ /*
+ * :TODO: for now overwrite with actual fclock as dss will not scale
+ * fclock based on composition
+ */
+ p->fclk = dispc_fclk_rate();
+
+ p->min_width = 2;
+ p->max_width = 2048;
+ p->max_height = 2048;
+
+ p->max_downscale = 4;
+ p->integer_scale_ratio_limit = 2048;
+
+ p->tiler1d_slot_size = tiler1d_slot_size(cdev);
+}
+
static long comp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
int r = 0;
@@ -487,6 +518,13 @@ static long comp_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
{
r = copy_from_user(&u.sdis, ptr, sizeof(u.sdis)) ? :
setup_display(cdev, &u.sdis);
+ break;
+ }
+ case DSSCIOC_QUERY_PLATFORM:
+ {
+ /* :TODO: for now refill platform info as it is dynamic */
+ r = copy_to_user(ptr, &platform_info, sizeof(platform_info));
+ break;
}
default:
r = -EINVAL;
@@ -564,6 +602,7 @@ static int dsscomp_probe(struct platform_device *pdev)
pr_info("dsscomp: initializing.\n");
fill_cache(cdev);
+ fill_platform_info(cdev);
/* initialize queues */
dsscomp_queue_init(cdev);
diff --git a/drivers/video/omap2/dsscomp/dsscomp.h b/drivers/video/omap2/dsscomp/dsscomp.h
index ae7f7b1..d8ff1aa 100644
--- a/drivers/video/omap2/dsscomp/dsscomp.h
+++ b/drivers/video/omap2/dsscomp/dsscomp.h
@@ -151,6 +151,13 @@ struct omap_overlay_manager *find_dss_mgr(int display_ix);
void swap_rb_in_ovl_info(struct dss2_ovl_info *oi);
void swap_rb_in_mgr_info(struct dss2_mgr_info *mi);
+static inline u32 tiler1d_slot_size(struct dsscomp_dev *cdev)
+{
+ struct dsscomp_platform_data *pdata;
+ pdata = (struct dsscomp_platform_data *)cdev->pdev->platform_data;
+ return pdata->tiler1d_slotsz;
+}
+
/*
* Debug functions
*/
diff --git a/drivers/video/omap2/dsscomp/gralloc.c b/drivers/video/omap2/dsscomp/gralloc.c
index f3da23b..6467434 100644
--- a/drivers/video/omap2/dsscomp/gralloc.c
+++ b/drivers/video/omap2/dsscomp/gralloc.c
@@ -24,6 +24,7 @@
#include <linux/vmalloc.h>
#include <mach/tiler.h>
#include <video/dsscomp.h>
+#include <plat/android-display.h>
#include <plat/dsscomp.h>
#include "dsscomp.h"
@@ -32,15 +33,13 @@
#endif
static bool blanked;
-#define NUM_TILER1D_SLOTS 2
-
static struct tiler1d_slot {
struct list_head q;
tiler_blk_handle slot;
u32 phys;
u32 size;
u32 *page_map;
-} slots[NUM_TILER1D_SLOTS];
+} slots[NUM_ANDROID_TILER1D_SLOTS];
static struct list_head free_slots;
static struct dsscomp_dev *cdev;
static DEFINE_MUTEX(mtx);
@@ -66,13 +65,6 @@ static LIST_HEAD(flip_queue);
static u32 ovl_use_mask[MAX_MANAGERS];
-static unsigned int tiler1d_slot_size(struct dsscomp_dev *cdev)
-{
- struct dsscomp_platform_data *pdata;
- pdata = (struct dsscomp_platform_data *)cdev->pdev->platform_data;
- return pdata->tiler1d_slotsz;
-}
-
static void unpin_tiler_blocks(struct list_head *slots)
{
struct tiler1d_slot *slot;
@@ -611,7 +603,7 @@ void dsscomp_gralloc_init(struct dsscomp_dev *cdev_)
if (!free_slots.next) {
INIT_LIST_HEAD(&free_slots);
- for (i = 0; i < NUM_TILER1D_SLOTS; i++) {
+ for (i = 0; i < NUM_ANDROID_TILER1D_SLOTS; i++) {
u32 phys;
tiler_blk_handle slot =
tiler_alloc_block_area(TILFMT_PAGE,
diff --git a/include/video/dsscomp.h b/include/video/dsscomp.h
index 91f1f87..d6fe147 100644
--- a/include/video/dsscomp.h
+++ b/include/video/dsscomp.h
@@ -650,6 +650,46 @@ struct dsscomp_wait_data {
enum dsscomp_wait_phase phase; /* phase to wait for */
};
+/*
+ * ioctl: DSSCIOC_QUERY_PLATFORM, struct dsscomp_platform_info
+ *
+ * Use this ioctl to get platform information needed to decide
+ * DSS/DSSCOMP capabilities, by filling out the passed structure with:
+ *
+ * A) predecimation limits
+ * B) maximum fclk (DSS is assumed to scale up to this fclk automatically
+ * to support frames)
+ * C) minimum and maximum sizes (for now we use the same limits for
+ * both source and window sizes, which works for OMAP4/5)
+ * D) scaler limitations. (assuming same max downscale limitation both
+ * horizontally/vertically; however, fclock requirements are only
+ * dependent on horizontal scaling, which works for OMAP4 ES1.1+ and
+ * OMAP5 only).
+ * integer_scale_ratio_limit is the maximum source width to round up
+ * fclock/pixclock to an integer.
+ * E) Tiler1D slot size
+ *
+ * Returns: 0 on success, <0 error value on failure (unlikely)
+ */
+
+struct dsscomp_platform_info {
+ /* decimation limits for 2D and 1D buffers */
+ __u8 max_xdecim_2d;
+ __u8 max_ydecim_2d;
+ __u8 max_xdecim_1d;
+ __u8 max_ydecim_1d;
+ __u32 fclk; /* dispc max fclk */
+ /* pipeline source/destination limits */
+ __u8 min_width;
+ __u16 max_width;
+ __u16 max_height;
+ /* scaler limitations */
+ __u8 max_downscale;
+ /* below this width, we assume integer pixelclk scale */
+ __u16 integer_scale_ratio_limit;
+ __u32 tiler1d_slot_size;
+};
+
/* IOCTLS */
#define DSSCIOC_SETUP_MGR _IOW('O', 128, struct dsscomp_setup_mgr_data)
#define DSSCIOC_CHECK_OVL _IOWR('O', 129, struct dsscomp_check_ovl_data)
@@ -659,4 +699,5 @@ struct dsscomp_wait_data {
#define DSSCIOC_SETUP_DISPC _IOW('O', 133, struct dsscomp_setup_dispc_data)
#define DSSCIOC_SETUP_DISPLAY _IOW('O', 134, struct dsscomp_setup_display_data)
+#define DSSCIOC_QUERY_PLATFORM _IOR('O', 135, struct dsscomp_platform_info)
#endif