From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
Archit Taneja <archit@ti.com>
Subject: [PATCH 5/6] OMAPDSS: MANAGER: Check validity of manager timings
Date: Mon, 16 Apr 2012 07:35:46 +0000 [thread overview]
Message-ID: <1334561027-28569-6-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1334561027-28569-1-git-send-email-archit@ti.com>
The manager timings is a member of the overlay_manager_info struct. We can now
check it's validity in dss_mgr_check(). Add a function dss_mgr_check_timings()
which checks if the timings are correct.
Currently, the manager timings are initialized in an interface's enable call.
Since a mgr_apply() can happen before the connected display is enabled, we
initialize the manager timings to a dummy valid value in apply_init().
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 22 ++++++++++++++++++++++
drivers/video/omap2/dss/dpi.c | 2 +-
drivers/video/omap2/dss/dss.h | 2 ++
drivers/video/omap2/dss/manager.c | 15 +++++++++++++++
4 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index b10b3bc..53a198f 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -132,10 +132,32 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)
void dss_apply_init(void)
{
const int num_ovls = dss_feat_get_num_ovls();
+ const int num_mgrs = dss_feat_get_num_ovls();
int i;
+ /* Use dummy manager timings during initialization */
+ struct omap_video_timings timings = {
+ .hsw = 1,
+ .hfp = 1,
+ .hbp = 1,
+ .vsw = 1,
+ .vfp = 0,
+ .vbp = 0,
+ .x_res = dss_feat_get_param_max(FEAT_PARAM_MGR_WIDTH),
+ .y_res = dss_feat_get_param_max(FEAT_PARAM_MGR_HEIGHT),
+ };
spin_lock_init(&data_lock);
+ for (i = 0; i < num_mgrs; i++) {
+ struct mgr_priv_data *mp;
+
+ mp = &dss_data.mgr_priv_data_array[i];
+
+ mp->info.timings = timings;
+
+ mp->user_info = mp->info;
+ }
+
for (i = 0; i < num_ovls; ++i) {
struct ovl_priv_data *op;
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 76e2cae..a1bdbf7 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -314,7 +314,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
unsigned long pck;
struct dispc_clock_info dispc_cinfo;
- if (!dispc_mgr_timings_ok(dssdev->manager->id, timings))
+ if (!dss_mgr_check_timings(dssdev->manager, timings))
return -EINVAL;
if (timings->pixel_clock = 0)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0bff325..9e47bdf 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -206,6 +206,8 @@ int dss_init_overlay_managers(struct platform_device *pdev);
void dss_uninit_overlay_managers(struct platform_device *pdev);
int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
const struct omap_overlay_manager_info *info);
+int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
+ struct omap_video_timings *timings);
int dss_mgr_check(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev,
struct omap_overlay_manager_info *info,
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 2c85988..fb61b76 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -654,6 +654,17 @@ static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr,
return 0;
}
+int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
+ struct omap_video_timings *timings)
+{
+ if (!dispc_mgr_timings_ok(mgr->id, timings)) {
+ DSSERR("check_manager: invalid timings\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
int dss_mgr_check(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev,
struct omap_overlay_manager_info *info,
@@ -668,6 +679,10 @@ int dss_mgr_check(struct omap_overlay_manager *mgr,
return r;
}
+ r = dss_mgr_check_timings(mgr, &info->timings);
+ if (r)
+ return r;
+
list_for_each_entry(ovl, &mgr->overlays, list) {
struct omap_overlay_info *oi;
int r;
--
1.7.5.4
WARNING: multiple messages have this Message-ID (diff)
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
Archit Taneja <archit@ti.com>
Subject: [PATCH 5/6] OMAPDSS: MANAGER: Check validity of manager timings
Date: Mon, 16 Apr 2012 12:53:46 +0530 [thread overview]
Message-ID: <1334561027-28569-6-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1334561027-28569-1-git-send-email-archit@ti.com>
The manager timings is a member of the overlay_manager_info struct. We can now
check it's validity in dss_mgr_check(). Add a function dss_mgr_check_timings()
which checks if the timings are correct.
Currently, the manager timings are initialized in an interface's enable call.
Since a mgr_apply() can happen before the connected display is enabled, we
initialize the manager timings to a dummy valid value in apply_init().
Signed-off-by: Archit Taneja <archit@ti.com>
---
drivers/video/omap2/dss/apply.c | 22 ++++++++++++++++++++++
drivers/video/omap2/dss/dpi.c | 2 +-
drivers/video/omap2/dss/dss.h | 2 ++
drivers/video/omap2/dss/manager.c | 15 +++++++++++++++
4 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index b10b3bc..53a198f 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -132,10 +132,32 @@ static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr)
void dss_apply_init(void)
{
const int num_ovls = dss_feat_get_num_ovls();
+ const int num_mgrs = dss_feat_get_num_ovls();
int i;
+ /* Use dummy manager timings during initialization */
+ struct omap_video_timings timings = {
+ .hsw = 1,
+ .hfp = 1,
+ .hbp = 1,
+ .vsw = 1,
+ .vfp = 0,
+ .vbp = 0,
+ .x_res = dss_feat_get_param_max(FEAT_PARAM_MGR_WIDTH),
+ .y_res = dss_feat_get_param_max(FEAT_PARAM_MGR_HEIGHT),
+ };
spin_lock_init(&data_lock);
+ for (i = 0; i < num_mgrs; i++) {
+ struct mgr_priv_data *mp;
+
+ mp = &dss_data.mgr_priv_data_array[i];
+
+ mp->info.timings = timings;
+
+ mp->user_info = mp->info;
+ }
+
for (i = 0; i < num_ovls; ++i) {
struct ovl_priv_data *op;
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 76e2cae..a1bdbf7 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -314,7 +314,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
unsigned long pck;
struct dispc_clock_info dispc_cinfo;
- if (!dispc_mgr_timings_ok(dssdev->manager->id, timings))
+ if (!dss_mgr_check_timings(dssdev->manager, timings))
return -EINVAL;
if (timings->pixel_clock == 0)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 0bff325..9e47bdf 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -206,6 +206,8 @@ int dss_init_overlay_managers(struct platform_device *pdev);
void dss_uninit_overlay_managers(struct platform_device *pdev);
int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
const struct omap_overlay_manager_info *info);
+int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
+ struct omap_video_timings *timings);
int dss_mgr_check(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev,
struct omap_overlay_manager_info *info,
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 2c85988..fb61b76 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -654,6 +654,17 @@ static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr,
return 0;
}
+int dss_mgr_check_timings(struct omap_overlay_manager *mgr,
+ struct omap_video_timings *timings)
+{
+ if (!dispc_mgr_timings_ok(mgr->id, timings)) {
+ DSSERR("check_manager: invalid timings\n");
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
int dss_mgr_check(struct omap_overlay_manager *mgr,
struct omap_dss_device *dssdev,
struct omap_overlay_manager_info *info,
@@ -668,6 +679,10 @@ int dss_mgr_check(struct omap_overlay_manager *mgr,
return r;
}
+ r = dss_mgr_check_timings(mgr, &info->timings);
+ if (r)
+ return r;
+
list_for_each_entry(ovl, &mgr->overlays, list) {
struct omap_overlay_info *oi;
int r;
--
1.7.5.4
next prev parent reply other threads:[~2012-04-16 7:35 UTC|newest]
Thread overview: 110+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-16 7:23 [PATCH 0/6] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Archit Taneja
2012-04-16 7:35 ` Archit Taneja
2012-04-16 7:23 ` [PATCH 1/6] OMAPDSS: DISPC/RFBI: Use dispc_mgr_set_lcd_timings() for setting lcd size Archit Taneja
2012-04-16 7:35 ` Archit Taneja
2012-04-16 7:23 ` [PATCH 2/6] OMAPDSS: DISPC: Use a common function to set manager timings Archit Taneja
2012-04-16 7:35 ` Archit Taneja
2012-04-16 7:23 ` [PATCH 3/6] OMAPDSS: DISPC: Clean up manager timing/size functions Archit Taneja
2012-04-16 7:35 ` Archit Taneja
2012-04-16 7:23 ` [PATCH 4/6] OMAPDSS: MANAGER: Make DISPC timings a manager_info parameter Archit Taneja
2012-04-16 7:35 ` Archit Taneja
2012-04-18 14:58 ` Tomi Valkeinen
2012-04-18 14:58 ` Tomi Valkeinen
2012-04-19 6:13 ` Archit Taneja
2012-04-19 6:25 ` Archit Taneja
2012-04-19 6:37 ` Tomi Valkeinen
2012-04-19 6:37 ` Tomi Valkeinen
2012-04-19 10:08 ` Archit Taneja
2012-04-19 10:20 ` Archit Taneja
2012-04-19 11:37 ` Tomi Valkeinen
2012-04-19 11:37 ` Tomi Valkeinen
2012-04-16 7:23 ` Archit Taneja [this message]
2012-04-16 7:35 ` [PATCH 5/6] OMAPDSS: MANAGER: Check validity of manager timings Archit Taneja
2012-04-16 7:23 ` [PATCH 6/6] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-04-16 7:35 ` Archit Taneja
2012-04-19 11:48 ` [PATCH 0/6] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Tomi Valkeinen
2012-04-19 11:48 ` Tomi Valkeinen
2012-04-19 11:58 ` Archit Taneja
2012-04-19 12:10 ` Archit Taneja
2012-04-19 12:00 ` Tomi Valkeinen
2012-04-19 12:00 ` Tomi Valkeinen
2012-05-03 7:07 ` [PATCH v2 0/4] " Archit Taneja
2012-05-03 7:19 ` Archit Taneja
2012-05-03 7:07 ` [PATCH v2 1/4] OMAPDSS: APPLY: Add manager timings as extra_info in private data Archit Taneja
2012-05-03 7:19 ` Archit Taneja
2012-05-07 14:47 ` Tomi Valkeinen
2012-05-07 14:47 ` Tomi Valkeinen
2012-05-08 4:24 ` Archit Taneja
2012-05-08 4:36 ` Archit Taneja
2012-05-08 7:01 ` Tomi Valkeinen
2012-05-08 7:01 ` Tomi Valkeinen
2012-05-03 7:07 ` [PATCH v2 2/4] OMAPDSS: Apply manager timings instead of direct DISPC writes Archit Taneja
2012-05-03 7:19 ` Archit Taneja
2012-05-03 7:07 ` [PATCH v2 3/4] OMAPDSS: MANAGER: Create a function to check manager timings Archit Taneja
2012-05-03 7:19 ` Archit Taneja
2012-05-03 7:07 ` [PATCH v2 4/4] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-05-03 7:19 ` Archit Taneja
2012-05-07 15:03 ` Tomi Valkeinen
2012-05-07 15:03 ` Tomi Valkeinen
2012-05-08 5:03 ` Archit Taneja
2012-05-08 5:15 ` Archit Taneja
2012-05-08 7:16 ` Tomi Valkeinen
2012-05-08 7:16 ` Tomi Valkeinen
2012-05-08 7:38 ` Archit Taneja
2012-05-08 7:50 ` Archit Taneja
2012-05-08 8:52 ` Tomi Valkeinen
2012-05-08 8:52 ` Tomi Valkeinen
2012-05-08 9:07 ` Archit Taneja
2012-05-08 9:19 ` Archit Taneja
2012-05-08 9:58 ` [PATCH v3 0/5] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Archit Taneja
2012-05-08 10:10 ` Archit Taneja
2012-05-08 9:58 ` [PATCH v3 1/5] OMAPDSS: APPLY: Add manager timings as extra_info in private data Archit Taneja
2012-05-08 10:10 ` Archit Taneja
2012-05-08 9:58 ` [PATCH v3 2/5] OMAPDSS: Apply manager timings instead of direct DISPC writes Archit Taneja
2012-05-08 10:10 ` Archit Taneja
2012-05-08 10:59 ` Tomi Valkeinen
2012-05-08 10:59 ` Tomi Valkeinen
2012-05-08 9:58 ` [PATCH v3 3/5] OMAPDSS: MANAGER: Create a function to check manager timings Archit Taneja
2012-05-08 10:10 ` Archit Taneja
2012-05-08 9:58 ` [PATCH v3 4/5] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-05-08 10:10 ` Archit Taneja
2012-05-08 10:50 ` Tomi Valkeinen
2012-05-08 10:50 ` Tomi Valkeinen
2012-05-08 11:22 ` Archit Taneja
2012-05-08 11:34 ` Archit Taneja
2012-05-08 11:55 ` Tomi Valkeinen
2012-05-08 11:55 ` Tomi Valkeinen
2012-05-08 12:35 ` Archit Taneja
2012-05-08 12:47 ` Archit Taneja
2012-05-09 9:53 ` Archit Taneja
2012-05-09 9:56 ` Archit Taneja
2012-05-09 10:15 ` Tomi Valkeinen
2012-05-09 10:15 ` Tomi Valkeinen
2012-05-08 9:58 ` [PATCH v3 5/5] OMAPDSS: DPI/HDMI: Apply manager timings even if panel is disabled Archit Taneja
2012-05-08 10:10 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 0/9] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 1/9] OMAPDSS: APPLY: Add manager timings as extra_info in private data Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 2/9] OMAPDSS: Apply manager timings instead of direct DISPC writes Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 3/9] OMAPDSS: MANAGER: Create a function to check manager timings Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 4/9] OMAPDSS: APPLY: Don't check manager settings if it is disabled Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 5/9] OMAPDSS: APPLY: Remove display dependency from overlay and manager checks Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 6/9] OMAPDSS: DPI/HDMI: Apply manager timings even if panel is disabled Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 7/9] OMAPDSS: APPLY: Remove an unnecessary omap_dss_device pointer Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 8/9] OMAPDSS: DISPC: Remove omap_dss_device pointer usage from dispc_mgr_pclk_rate() Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 10:10 ` [PATCH v4 9/9] OMAPDSS: DISPC: Remove usage of dispc_mgr_get_device() Archit Taneja
2012-05-09 10:22 ` Archit Taneja
2012-05-09 11:13 ` [PATCH v4 0/9] OMAPDSS: APPLY: Treat overlay manager timings as shadow registers Tomi Valkeinen
2012-05-09 11:13 ` Tomi Valkeinen
2012-05-09 11:24 ` Archit Taneja
2012-05-09 11:36 ` Archit Taneja
2012-05-09 11:51 ` Tomi Valkeinen
2012-05-09 11:51 ` Tomi Valkeinen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1334561027-28569-6-git-send-email-archit@ti.com \
--to=archit@ti.com \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=tomi.valkeinen@ti.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.