* [PATCH 09/20] OMAPDSS: add dispc_ovl_enabled()
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
Add new dispc function, dispc_ovl_enabled(). This returns if the overlay
enable bit is set in the registers.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dispc.c | 5 +++++
drivers/video/omap2/dss/dss.h | 1 +
2 files changed, 6 insertions(+)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index b5cdbaf..3fd60ce 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -2589,6 +2589,11 @@ int dispc_ovl_enable(enum omap_plane plane, bool enable)
return 0;
}
+bool dispc_ovl_enabled(enum omap_plane plane)
+{
+ return REG_GET(DISPC_OVL_ATTRIBUTES(plane), 0, 0);
+}
+
static void dispc_mgr_disable_isr(void *data, u32 mask)
{
struct completion *compl = data;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index b007aee..be7678c 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -428,6 +428,7 @@ int dispc_ovl_setup(enum omap_plane plane, const struct omap_overlay_info *oi,
bool replication, const struct omap_video_timings *mgr_timings,
bool mem_to_mem);
int dispc_ovl_enable(enum omap_plane plane, bool enable);
+bool dispc_ovl_enabled(enum omap_plane plane);
void dispc_ovl_set_channel_out(enum omap_plane plane,
enum omap_channel channel);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 10/20] OMAPDSS: DISPC: Add IRQ enable/status helpers
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
DISPC irqs need to be handled from the compat layer and also in the
future by the omapdrm. To make this possible, this patchs adds a set of
helper functions, so that the irqs can be managed without direct
register reads/writes.
The following functions are added, and all the current direct reg
reads/writes are changed to use these.
u32 dispc_read_irqstatus(void);
void dispc_clear_irqstatus(u32 mask);
u32 dispc_read_irqenable(void);
void dispc_write_irqenable(u32 mask);
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dispc.c | 44 ++++++++++++++++++++++++++++-----------
drivers/video/omap2/dss/dss.h | 4 ++++
2 files changed, 36 insertions(+), 12 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 3fd60ce..d294873 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -497,7 +497,7 @@ static void dispc_restore_context(void)
if (dss_has_feature(FEAT_MGR_LCD3))
RR(CONTROL3);
/* clear spurious SYNC_LOST_DIGIT interrupts */
- dispc_write_reg(DISPC_IRQSTATUS, DISPC_IRQ_SYNC_LOST_DIGIT);
+ dispc_clear_irqstatus(DISPC_IRQ_SYNC_LOST_DIGIT);
/*
* enable last so IRQs won't trigger before
@@ -3627,11 +3627,35 @@ int dispc_mgr_get_clock_div(enum omap_channel channel,
return 0;
}
+u32 dispc_read_irqstatus(void)
+{
+ return dispc_read_reg(DISPC_IRQSTATUS);
+}
+
+void dispc_clear_irqstatus(u32 mask)
+{
+ dispc_write_reg(DISPC_IRQSTATUS, mask);
+}
+
+u32 dispc_read_irqenable(void)
+{
+ return dispc_read_reg(DISPC_IRQENABLE);
+}
+
+void dispc_write_irqenable(u32 mask)
+{
+ u32 old_mask = dispc_read_reg(DISPC_IRQENABLE);
+
+ /* clear the irqstatus for newly enabled irqs */
+ dispc_clear_irqstatus((mask ^ old_mask) & mask);
+
+ dispc_write_reg(DISPC_IRQENABLE, mask);
+}
+
/* dispc.irq_lock has to be locked by the caller */
static void _omap_dispc_set_irqs(void)
{
u32 mask;
- u32 old_mask;
int i;
struct omap_dispc_isr_data *isr_data;
@@ -3646,11 +3670,7 @@ static void _omap_dispc_set_irqs(void)
mask |= isr_data->mask;
}
- old_mask = dispc_read_reg(DISPC_IRQENABLE);
- /* clear the irqstatus for newly enabled irqs */
- dispc_write_reg(DISPC_IRQSTATUS, (mask ^ old_mask) & mask);
-
- dispc_write_reg(DISPC_IRQENABLE, mask);
+ dispc_write_irqenable(mask);
}
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask)
@@ -3777,8 +3797,8 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *arg)
spin_lock(&dispc.irq_lock);
- irqstatus = dispc_read_reg(DISPC_IRQSTATUS);
- irqenable = dispc_read_reg(DISPC_IRQENABLE);
+ irqstatus = dispc_read_irqstatus();
+ irqenable = dispc_read_irqenable();
/* IRQ is not for us */
if (!(irqstatus & irqenable)) {
@@ -3797,9 +3817,9 @@ static irqreturn_t omap_dispc_irq_handler(int irq, void *arg)
/* Ack the interrupt. Do it here before clocks are possibly turned
* off */
- dispc_write_reg(DISPC_IRQSTATUS, irqstatus);
+ dispc_clear_irqstatus(irqstatus);
/* flush posted write */
- dispc_read_reg(DISPC_IRQSTATUS);
+ dispc_read_irqstatus();
/* make a copy and unlock, so that isrs can unregister
* themselves */
@@ -4008,7 +4028,7 @@ static void _omap_dispc_initialize_irq(void)
/* there's SYNC_LOST_DIGIT waiting after enabling the DSS,
* so clear it */
- dispc_write_reg(DISPC_IRQSTATUS, dispc_read_reg(DISPC_IRQSTATUS));
+ dispc_clear_irqstatus(dispc_read_irqstatus());
_omap_dispc_set_irqs();
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index be7678c..8bf9047 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -398,6 +398,10 @@ void dpi_uninit_platform_driver(void) __exit;
int dispc_init_platform_driver(void) __init;
void dispc_uninit_platform_driver(void) __exit;
void dispc_dump_clocks(struct seq_file *s);
+u32 dispc_read_irqstatus(void);
+void dispc_clear_irqstatus(u32 mask);
+u32 dispc_read_irqenable(void);
+void dispc_write_irqenable(u32 mask);
int dispc_runtime_get(void);
void dispc_runtime_put(void);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 11/20] OMAPDSS: HDMI: split power_on/off to two parts
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen, Ricardo Neri
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
There's currently just one power-on function for HDMI, which enables the
IP and the video output. When reading EDID or detecting if a monitor is
connected, we don't need the video output.
Enabling the video output for these operations is not a big problem in
itself, but the quick enable/disable cycles caused by the operations
seem to cause sync lost errors from time to time. Also, this makes it
possible to read the EDID before the full video path has been set up.
This patch splits the hdmi_power_on into two parts, hdmi_power_on_core
and hdmi_power_on_full. The "full" version does what hdmi_power_on does
currently, and hdmi_power_on_core only enables the core IP. Similar
changes are made for power_off.
Note that these don't allow the HDMI IP to be first enabled, and later
enable the video output, but the HDMI IP will first need to be powered
off before calling the full version. So this is rather limited
implementation, but it fills the needs for reading EDID.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
---
drivers/video/omap2/dss/hdmi.c | 75 ++++++++++++++++++++++++----------------
1 file changed, 46 insertions(+), 29 deletions(-)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index c1c5488..50d5a10 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -500,12 +500,9 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
DSSDBG("range = %d sd = %d\n", pi->dcofreq, pi->regsd);
}
-static int hdmi_power_on(struct omap_dss_device *dssdev)
+static int hdmi_power_on_core(struct omap_dss_device *dssdev)
{
int r;
- struct omap_video_timings *p;
- struct omap_overlay_manager *mgr = dssdev->output->manager;
- unsigned long phy;
gpio_set_value(hdmi.ct_cp_hpd_gpio, 1);
gpio_set_value(hdmi.ls_oe_gpio, 1);
@@ -521,6 +518,46 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
if (r)
goto err_runtime_get;
+ /* Make selection of HDMI in DSS */
+ dss_select_hdmi_venc_clk_source(DSS_HDMI_M_PCLK);
+
+ /* Select the dispc clock source as PRCM clock, to ensure that it is not
+ * DSI PLL source as the clock selected by DSI PLL might not be
+ * sufficient for the resolution selected / that can be changed
+ * dynamically by user. This can be moved to single location , say
+ * Boardfile.
+ */
+ dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
+
+ return 0;
+
+err_runtime_get:
+ regulator_disable(hdmi.vdda_hdmi_dac_reg);
+err_vdac_enable:
+ gpio_set_value(hdmi.ct_cp_hpd_gpio, 0);
+ gpio_set_value(hdmi.ls_oe_gpio, 0);
+ return r;
+}
+
+static void hdmi_power_off_core(struct omap_dss_device *dssdev)
+{
+ hdmi_runtime_put();
+ regulator_disable(hdmi.vdda_hdmi_dac_reg);
+ gpio_set_value(hdmi.ct_cp_hpd_gpio, 0);
+ gpio_set_value(hdmi.ls_oe_gpio, 0);
+}
+
+static int hdmi_power_on_full(struct omap_dss_device *dssdev)
+{
+ int r;
+ struct omap_video_timings *p;
+ struct omap_overlay_manager *mgr = dssdev->output->manager;
+ unsigned long phy;
+
+ r = hdmi_power_on_core(dssdev);
+ if (r)
+ return r;
+
dss_mgr_disable(mgr);
p = &hdmi.ip_data.cfg.timings;
@@ -548,17 +585,6 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
hdmi.ip_data.ops->video_configure(&hdmi.ip_data);
- /* Make selection of HDMI in DSS */
- dss_select_hdmi_venc_clk_source(DSS_HDMI_M_PCLK);
-
- /* Select the dispc clock source as PRCM clock, to ensure that it is not
- * DSI PLL source as the clock selected by DSI PLL might not be
- * sufficient for the resolution selected / that can be changed
- * dynamically by user. This can be moved to single location , say
- * Boardfile.
- */
- dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
-
/* bypass TV gamma table */
dispc_enable_gamma_table(0);
@@ -582,16 +608,11 @@ err_vid_enable:
err_phy_enable:
hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
err_pll_enable:
- hdmi_runtime_put();
-err_runtime_get:
- regulator_disable(hdmi.vdda_hdmi_dac_reg);
-err_vdac_enable:
- gpio_set_value(hdmi.ct_cp_hpd_gpio, 0);
- gpio_set_value(hdmi.ls_oe_gpio, 0);
+ hdmi_power_off_core(dssdev);
return -EIO;
}
-static void hdmi_power_off(struct omap_dss_device *dssdev)
+static void hdmi_power_off_full(struct omap_dss_device *dssdev)
{
struct omap_overlay_manager *mgr = dssdev->output->manager;
@@ -600,12 +621,8 @@ static void hdmi_power_off(struct omap_dss_device *dssdev)
hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
hdmi.ip_data.ops->pll_disable(&hdmi.ip_data);
- hdmi_runtime_put();
- regulator_disable(hdmi.vdda_hdmi_dac_reg);
-
- gpio_set_value(hdmi.ct_cp_hpd_gpio, 0);
- gpio_set_value(hdmi.ls_oe_gpio, 0);
+ hdmi_power_off_core(dssdev);
}
int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
@@ -713,7 +730,7 @@ int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
goto err0;
}
- r = hdmi_power_on(dssdev);
+ r = hdmi_power_on_full(dssdev);
if (r) {
DSSERR("failed to power on device\n");
goto err1;
@@ -735,7 +752,7 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
mutex_lock(&hdmi.lock);
- hdmi_power_off(dssdev);
+ hdmi_power_off_full(dssdev);
omap_dss_stop_device(dssdev);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 12/20] OMAPDSS: HDMI: use core power on/off with edid & detect
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen, Ricardo Neri
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
This patch makes use of the hdmi_power_[on|off]_core() functions added
in the previous patch. The functions are used when reading EDID or
detecting if a monitor is connected.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
---
drivers/video/omap2/dss/dss.h | 2 ++
drivers/video/omap2/dss/hdmi.c | 35 ++++++++++++++++++++++++++++++++++
drivers/video/omap2/dss/hdmi_panel.c | 8 ++++----
3 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 8bf9047..2305b80 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -510,6 +510,8 @@ static inline unsigned long hdmi_get_pixel_clock(void)
#endif
int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
+int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev);
+void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev);
void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
struct omap_video_timings *timings);
int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 50d5a10..b809490 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -759,6 +759,41 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
mutex_unlock(&hdmi.lock);
}
+int omapdss_hdmi_core_enable(struct omap_dss_device *dssdev)
+{
+ int r = 0;
+
+ DSSDBG("ENTER omapdss_hdmi_core_enable\n");
+
+ mutex_lock(&hdmi.lock);
+
+ hdmi.ip_data.hpd_gpio = hdmi.hpd_gpio;
+
+ r = hdmi_power_on_core(dssdev);
+ if (r) {
+ DSSERR("failed to power on device\n");
+ goto err0;
+ }
+
+ mutex_unlock(&hdmi.lock);
+ return 0;
+
+err0:
+ mutex_unlock(&hdmi.lock);
+ return r;
+}
+
+void omapdss_hdmi_core_disable(struct omap_dss_device *dssdev)
+{
+ DSSDBG("Enter omapdss_hdmi_core_disable\n");
+
+ mutex_lock(&hdmi.lock);
+
+ hdmi_power_off_core(dssdev);
+
+ mutex_unlock(&hdmi.lock);
+}
+
static int hdmi_get_clocks(struct platform_device *pdev)
{
struct clk *clk;
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index 3f9a4b9..a385b69 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -334,7 +334,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
need_enable = dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
if (need_enable) {
- r = omapdss_hdmi_display_enable(dssdev);
+ r = omapdss_hdmi_core_enable(dssdev);
if (r)
goto err;
}
@@ -342,7 +342,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
r = omapdss_hdmi_read_edid(buf, len);
if (need_enable)
- omapdss_hdmi_display_disable(dssdev);
+ omapdss_hdmi_core_disable(dssdev);
err:
mutex_unlock(&hdmi.lock);
@@ -359,7 +359,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
need_enable = dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
if (need_enable) {
- r = omapdss_hdmi_display_enable(dssdev);
+ r = omapdss_hdmi_core_enable(dssdev);
if (r)
goto err;
}
@@ -367,7 +367,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
r = omapdss_hdmi_detect();
if (need_enable)
- omapdss_hdmi_display_disable(dssdev);
+ omapdss_hdmi_core_disable(dssdev);
err:
mutex_unlock(&hdmi.lock);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 13/20] OMAPDSS: HDMI: add 1920x1200 video mode
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen, Ricardo Neri
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
Add 1920x1200 video mode to hdmi driver's static modelist.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
---
drivers/video/omap2/dss/hdmi.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index b809490..dfbc1e7 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -295,6 +295,12 @@ static const struct hdmi_config vesa_timings[] = {
false, },
{ 0x55, HDMI_DVI },
},
+ {
+ { 1920, 1200, 154000, 32, 48, 80, 6, 3, 26,
+ OMAPDSS_SIG_ACTIVE_LOW, OMAPDSS_SIG_ACTIVE_HIGH,
+ false, },
+ { 0x44, HDMI_DVI },
+ },
};
static int hdmi_runtime_get(void)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 14/20] OMAPDSS: HDMI: make hdmi pclk check more permissive
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen, Ricardo Neri
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
The hdmi driver tries to find the given video timings from its static
list of timings, to find the required ID for the mode. The check tries
to find exact match for the pixel clock, among other checks.
with omapfb driver there can be some amount of error in the give pixel
clock, as the pixel clock is converted between Hz and ps, thus the
hdmi's check fails to find the mode.
This patch makes the check more allowing, by rounding the pixel clocks
to nearest MHz.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
---
drivers/video/omap2/dss/hdmi.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index dfbc1e7..90cc1b1 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -404,7 +404,8 @@ static bool hdmi_timings_compare(struct omap_video_timings *timing1,
{
int timing1_vsync, timing1_hsync, timing2_vsync, timing2_hsync;
- if ((timing2->pixel_clock = timing1->pixel_clock) &&
+ if ((DIV_ROUND_CLOSEST(timing2->pixel_clock, 1000) =
+ DIV_ROUND_CLOSEST(timing1->pixel_clock, 1000)) &&
(timing2->x_res = timing1->x_res) &&
(timing2->y_res = timing1->y_res)) {
--
1.7.9.5
^ permalink raw reply related
* [PATCH 15/20] OMAPFB: remove use of extended edid block
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
It seems that using the second EDID block causes more problems than is
of any help. The first mode in the extended block will get
FB_MODE_IS_FIRST set, which will override the first mode from the first
EDID block, thus making the default videomode selection not to work
properly.
This patch removes the use of the extended edid block for now.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index c0ff8b5ad..fe37039 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2272,9 +2272,6 @@ static int omapfb_find_best_mode(struct omap_dss_device *display,
fb_edid_to_monspecs(edid, specs);
- if (edid[126] > 0)
- fb_edid_add_monspecs(edid + 0x80, specs);
-
best_xres = 0;
best_idx = -1;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 16/20] OMAPFB: improve mode selection from EDID
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
The current omapfb code goes over all the modes found from the monitors
EDID data, and searches for a mode that is compatible with the DSS
hardware and has the highest x-res.
While this works ok as such, it proves problematic when using DSI PLL
for pixel clock. Calculating DSI PLL dividers is not the fastest of the
operations, and while doing it for one mode is usually ok, doing it for
20 modes is noticable.
Also, the first mode given in the EDID data should be the native mode of
the monitor, and thus also the best mode, so if that can be used, no
need to look further.
This patch changes the code to use the first mode that is compatible
with the DSS hardware.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index fe37039..1017832 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -2256,7 +2256,7 @@ static int omapfb_find_best_mode(struct omap_dss_device *display,
{
struct fb_monspecs *specs;
u8 *edid;
- int r, i, best_xres, best_idx, len;
+ int r, i, best_idx, len;
if (!display->driver->read_edid)
return -ENODEV;
@@ -2272,7 +2272,6 @@ static int omapfb_find_best_mode(struct omap_dss_device *display,
fb_edid_to_monspecs(edid, specs);
- best_xres = 0;
best_idx = -1;
for (i = 0; i < specs->modedb_len; ++i) {
@@ -2288,16 +2287,20 @@ static int omapfb_find_best_mode(struct omap_dss_device *display,
if (m->xres = 2880 || m->xres = 1440)
continue;
+ if (m->vmode & FB_VMODE_INTERLACED ||
+ m->vmode & FB_VMODE_DOUBLE)
+ continue;
+
fb_videomode_to_omap_timings(m, display, &t);
r = display->driver->check_timings(display, &t);
- if (r = 0 && best_xres < m->xres) {
- best_xres = m->xres;
+ if (r = 0) {
best_idx = i;
+ break;
}
}
- if (best_xres = 0) {
+ if (best_idx = -1) {
r = -ENOENT;
goto err2;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 17/20] OMAPDSS: fix DSI2 PLL clk names
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
dss_generic_clk_source_names is missing the names for clocks from DSI2
PLL. Add them.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dss.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index d90de37..456118b 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -97,6 +97,8 @@ static const char * const dss_generic_clk_source_names[] = {
[OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DISPC] = "DSI_PLL_HSDIV_DISPC",
[OMAP_DSS_CLK_SRC_DSI_PLL_HSDIV_DSI] = "DSI_PLL_HSDIV_DSI",
[OMAP_DSS_CLK_SRC_FCK] = "DSS_FCK",
+ [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DISPC] = "DSI_PLL2_HSDIV_DISPC",
+ [OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI] = "DSI_PLL2_HSDIV_DSI",
};
static inline void dss_write_reg(const struct dss_reg idx, u32 val)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 18/20] OMAPDSS: DISPC: fix loop in error handler
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
The dispc's error handler has a loop inside another loop, and both use
the same loop variable. This is clearly wrong, and this patch makes a
new variable for the inner loop.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dispc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index d294873..070ce30 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3901,6 +3901,7 @@ static void dispc_error_worker(struct work_struct *work)
bit = mgr_desc[i].sync_lost_irq;
if (bit & errors) {
+ int j;
struct omap_dss_device *dssdev = mgr->get_device(mgr);
bool enable;
@@ -3911,9 +3912,9 @@ static void dispc_error_worker(struct work_struct *work)
enable = dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
dssdev->driver->disable(dssdev);
- for (i = 0; i < omap_dss_get_num_overlays(); ++i) {
+ for (j = 0; j < omap_dss_get_num_overlays(); ++j) {
struct omap_overlay *ovl;
- ovl = omap_dss_get_overlay(i);
+ ovl = omap_dss_get_overlay(j);
if (ovl->id != OMAP_DSS_GFX &&
ovl->manager = mgr)
--
1.7.9.5
^ permalink raw reply related
* [PATCH 19/20] OMAPDSS: DISPC: remove dssdev depependency from error handler
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
The dispc error handler tries to "fix" issues by disabling and enabling
panel. This is problematic, as we're trying to remove the dependency
from omapdss to the omap_dss_devices. It's also racy, and doesn't really
fix anything.
This patch removes the use of omap_dss_device from the error handler,
and just disables and enables the associated overlay manager. This
should produce similar results as the previous solution, without using
dssdev.
However, the error handling is still horrible. But the problem boils
down to one question, to which I don't have a clear answer: what to do
when a HW error happens?
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/omap2/dss/dispc.c | 19 ++++---------------
1 file changed, 4 insertions(+), 15 deletions(-)
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 070ce30..61b48ca 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3902,15 +3902,12 @@ static void dispc_error_worker(struct work_struct *work)
if (bit & errors) {
int j;
- struct omap_dss_device *dssdev = mgr->get_device(mgr);
- bool enable;
DSSERR("SYNC_LOST on channel %s, restarting the output "
"with video overlays disabled\n",
mgr->name);
- enable = dssdev->state = OMAP_DSS_DISPLAY_ACTIVE;
- dssdev->driver->disable(dssdev);
+ dss_mgr_disable(mgr);
for (j = 0; j < omap_dss_get_num_overlays(); ++j) {
struct omap_overlay *ovl;
@@ -3918,14 +3915,10 @@ static void dispc_error_worker(struct work_struct *work)
if (ovl->id != OMAP_DSS_GFX &&
ovl->manager = mgr)
- dispc_ovl_enable(ovl->id, false);
+ dss_ovl_disable(ovl);
}
- dispc_mgr_go(mgr->id);
- msleep(50);
-
- if (enable)
- dssdev->driver->enable(dssdev);
+ dss_mgr_enable(mgr);
}
}
@@ -3933,13 +3926,9 @@ static void dispc_error_worker(struct work_struct *work)
DSSERR("OCP_ERR\n");
for (i = 0; i < omap_dss_get_num_overlay_managers(); ++i) {
struct omap_overlay_manager *mgr;
- struct omap_dss_device *dssdev;
mgr = omap_dss_get_overlay_manager(i);
- dssdev = mgr->get_device(mgr);
-
- if (dssdev && dssdev->driver)
- dssdev->driver->disable(dssdev);
+ dss_mgr_disable(mgr);
}
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH 20/20] OMAPDSS: split hdmi muxing function
From: Tomi Valkeinen @ 2012-10-24 9:29 UTC (permalink / raw)
To: archit, linux-omap, linux-fbdev; +Cc: Tomi Valkeinen, Ricardo Neri
In-Reply-To: <1351070951-18616-1-git-send-email-tomi.valkeinen@ti.com>
Split the omap4_hdmi_mux_pads() function into two parts, one handles the
tpd12s015 gpio muxing, the other handles the hdmi pins.
This is clearer, as hdmi and tpd12s015 are separate devices, and it also
allows us to mux those separately with DT.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Cc: Ricardo Neri <ricardo.neri@ti.com>
---
arch/arm/mach-omap2/display.c | 15 ++++++++++-----
1 file changed, 10 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-omap2/display.c b/arch/arm/mach-omap2/display.c
index 28f5087..282c814e 100644
--- a/arch/arm/mach-omap2/display.c
+++ b/arch/arm/mach-omap2/display.c
@@ -100,17 +100,20 @@ static const struct omap_dss_hwmod_data omap4_dss_hwmod_data[] __initconst = {
{ "dss_hdmi", "omapdss_hdmi", -1 },
};
-static void __init omap4_hdmi_mux_pads(enum omap_hdmi_flags flags)
+static void __init omap4_tpd12s015_mux_pads(void)
{
- u32 reg;
- u16 control_i2c_1;
-
omap_mux_init_signal("hdmi_cec",
OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("hdmi_ddc_scl",
OMAP_PIN_INPUT_PULLUP);
omap_mux_init_signal("hdmi_ddc_sda",
OMAP_PIN_INPUT_PULLUP);
+}
+
+static void __init omap4_hdmi_mux_pads(enum omap_hdmi_flags flags)
+{
+ u32 reg;
+ u16 control_i2c_1;
/*
* CONTROL_I2C_1: HDMI_DDC_SDA_PULLUPRESX (bit 28) and
@@ -161,8 +164,10 @@ static int omap4_dsi_mux_pads(int dsi_id, unsigned lanes)
int __init omap_hdmi_init(enum omap_hdmi_flags flags)
{
- if (cpu_is_omap44xx())
+ if (cpu_is_omap44xx()) {
omap4_hdmi_mux_pads(flags);
+ omap4_tpd12s015_mux_pads();
+ }
return 0;
}
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH 20/20] OMAPDSS: split hdmi muxing function
From: Tony Lindgren @ 2012-10-24 16:23 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: archit, linux-omap, linux-fbdev, Ricardo Neri
In-Reply-To: <1351070951-18616-21-git-send-email-tomi.valkeinen@ti.com>
* Tomi Valkeinen <tomi.valkeinen@ti.com> [121024 02:32]:
> Split the omap4_hdmi_mux_pads() function into two parts, one handles the
> tpd12s015 gpio muxing, the other handles the hdmi pins.
>
> This is clearer, as hdmi and tpd12s015 are separate devices, and it also
> allows us to mux those separately with DT.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Cc: Ricardo Neri <ricardo.neri@ti.com>
Looks OK to me to merge with the rest of the DSS patches:
Acked-by: Tony Lindgren <tony@atomide.com>
^ permalink raw reply
* [PATCH] omapdss: dss: Fix clocks on OMAP363x
From: Laurent Pinchart @ 2012-10-25 18:42 UTC (permalink / raw)
To: tomi.valkeinen; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra
Commit 185bae1095188aa199c9be64d6030d8dbfc65e0a ("OMAPDSS: DSS: Cleanup
cpu_is_xxxx checks") broke the DSS clocks configuration by erroneously
using the clock parameters applicable to all other OMAP34xx SoCs for the
OMAP363x. This went unnoticed probably because the cpu_is_omap34xx()
class check wasn't seen as matching the OMAP363x subclass.
Fix it by checking for the OMAP363x subclass before checking for the
OMAP34xx class.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
drivers/video/omap2/dss/dss.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
Hi Tomi,
The patch has been tested on the Beagleboard-xM and restores the DVI output
operation. This is a regression fix that should be pushed to v3.7.
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 2ab1c3e..0bb7406 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -805,10 +805,10 @@ static int __init dss_init_features(struct device *dev)
if (cpu_is_omap24xx())
src = &omap24xx_dss_feats;
- else if (cpu_is_omap34xx())
- src = &omap34xx_dss_feats;
else if (cpu_is_omap3630())
src = &omap3630_dss_feats;
+ else if (cpu_is_omap34xx())
+ src = &omap34xx_dss_feats;
else if (cpu_is_omap44xx())
src = &omap44xx_dss_feats;
else if (soc_is_omap54xx())
--
Regards,
Laurent Pinchart
^ permalink raw reply related
* Re: [PATCH] omapdss: dss: Fix clocks on OMAP363x
From: Tomi Valkeinen @ 2012-10-26 6:17 UTC (permalink / raw)
To: Laurent Pinchart; +Cc: linux-omap, linux-fbdev, Chandrabhanu Mahapatra
In-Reply-To: <1351190530-16863-1-git-send-email-laurent.pinchart@ideasonboard.com>
[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]
On 2012-10-25 21:42, Laurent Pinchart wrote:
> Commit 185bae1095188aa199c9be64d6030d8dbfc65e0a ("OMAPDSS: DSS: Cleanup
> cpu_is_xxxx checks") broke the DSS clocks configuration by erroneously
> using the clock parameters applicable to all other OMAP34xx SoCs for the
> OMAP363x. This went unnoticed probably because the cpu_is_omap34xx()
> class check wasn't seen as matching the OMAP363x subclass.
>
> Fix it by checking for the OMAP363x subclass before checking for the
> OMAP34xx class.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/video/omap2/dss/dss.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
>
> Hi Tomi,
>
> The patch has been tested on the Beagleboard-xM and restores the DVI output
> operation. This is a regression fix that should be pushed to v3.7.
>
> diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
> index 2ab1c3e..0bb7406 100644
> --- a/drivers/video/omap2/dss/dss.c
> +++ b/drivers/video/omap2/dss/dss.c
> @@ -805,10 +805,10 @@ static int __init dss_init_features(struct device *dev)
>
> if (cpu_is_omap24xx())
> src = &omap24xx_dss_feats;
> - else if (cpu_is_omap34xx())
> - src = &omap34xx_dss_feats;
> else if (cpu_is_omap3630())
> src = &omap3630_dss_feats;
> + else if (cpu_is_omap34xx())
> + src = &omap34xx_dss_feats;
> else if (cpu_is_omap44xx())
> src = &omap44xx_dss_feats;
> else if (soc_is_omap54xx())
>
Good catch, thanks. I don't have a 36xx board, so this went unnoticed.
I'll push it for 3.7-rc.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 897 bytes --]
^ permalink raw reply
* [PATCH 1/3] video: s3c-fb: add "drop through" comment
From: Jingoo Han @ 2012-10-26 7:00 UTC (permalink / raw)
To: linux-fbdev
This patch adds a "drop through" comment to improve
the readability.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/s3c-fb.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 2ed7b63..89cd278 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -288,6 +288,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
/* 666 with one bit alpha/transparency */
var->transp.offset = 18;
var->transp.length = 1;
+ /* drop through */
case 18:
var->bits_per_pixel = 32;
--
1.7.1
^ permalink raw reply related
* [PATCH 2/3] video: s3c-fb: return an error when bpp is invalid
From: Jingoo Han @ 2012-10-26 7:01 UTC (permalink / raw)
To: linux-fbdev
This patch returns an error, when bpp is invalid in
s3c_fb_check_var(). If invalid bpp is requested,
an error should be returned.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/s3c-fb.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index 89cd278..f453b8b 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -330,6 +330,7 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
default:
dev_err(sfb->dev, "invalid bpp\n");
+ return -EINVAL;
}
dev_dbg(sfb->dev, "%s: verified parameters\n", __func__);
--
1.7.1
^ permalink raw reply related
* [PATCH 3/3] video: s3c-fb: fix red offset and lengh for ARGB232 format
From: Jingoo Han @ 2012-10-26 7:02 UTC (permalink / raw)
To: linux-fbdev
Green pixel and blue pixel are 3 bits and 2 bits respectively
at ARGB232 format. Thus, the value of red offset should be 5,
not 4. Also, the value of red length should be 2, because
red pixel is 2 bits at ARGB232 format.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
---
drivers/video/s3c-fb.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index f453b8b..d8bfb4a 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -268,10 +268,10 @@ static int s3c_fb_check_var(struct fb_var_screeninfo *var,
case 8:
if (sfb->variant.palette[win->index] != 0) {
/* non palletised, A:1,R:2,G:3,B:2 mode */
- var->red.offset = 4;
+ var->red.offset = 5;
var->green.offset = 2;
var->blue.offset = 0;
- var->red.length = 5;
+ var->red.length = 2;
var->green.length = 3;
var->blue.length = 2;
var->transp.offset = 7;
--
1.7.1
^ permalink raw reply related
* Re: tty, vt: lockdep warnings
From: Alan Cox @ 2012-10-26 13:37 UTC (permalink / raw)
To: Sasha Levin
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-kernel@vger.kernel.org,
Dave Jones, linux-fbdev, florianSchandinat
In-Reply-To: <50899507.1040900@oracle.com>
On Thu, 25 Oct 2012 15:37:43 -0400
Sasha Levin <sasha.levin@oracle.com> wrote:
> Hi all,
>
> While fuzzing with trinity inside a KVM tools (lkvm) guest running latest -next kernel,
> I've stumbled on the following spew:
Looks real enough but its not a tty/vt layer spew. This is all coming out
of the core framebuffer code which doesn't seem to be able to decide what
the locking rules at the invocation of fb_notifier_call_chain are.
It might need some console layer tweaking to provide 'register console
and I already hold the locks' or similar but that notifier needs some
kind of sanity applying as well.
Cc'ing the fbdev folks
Alan
^ permalink raw reply
* [PATCH] lms283gf05: add suspend/resume handlers
From: Vasily Khoruzhick @ 2012-10-28 15:49 UTC (permalink / raw)
To: linux-fbdev
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
---
drivers/video/backlight/lms283gf05.c | 42 ++++++++++++++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/drivers/video/backlight/lms283gf05.c b/drivers/video/backlight/lms283gf05.c
index ea43f22..ed15752 100644
--- a/drivers/video/backlight/lms283gf05.c
+++ b/drivers/video/backlight/lms283gf05.c
@@ -22,6 +22,7 @@
struct lms283gf05_state {
struct spi_device *spi;
struct lcd_device *ld;
+ unsigned int power;
};
struct lms283gf05_seq {
@@ -130,6 +131,8 @@ static int lms283gf05_power_set(struct lcd_device *ld, int power)
struct spi_device *spi = st->spi;
struct lms283gf05_pdata *pdata = spi->dev.platform_data;
+ st->power = power;
+
if (power <= FB_BLANK_NORMAL) {
if (pdata)
lms283gf05_reset(pdata->reset_gpio,
@@ -193,6 +196,43 @@ static int __devinit lms283gf05_probe(struct spi_device *spi)
return 0;
}
+#if defined(CONFIG_PM)
+static unsigned int before_power;
+
+static int lms283gf05_suspend(struct spi_device *spi, pm_message_t mesg)
+{
+ int ret = 0;
+ struct lms283gf05_state *state = dev_get_drvdata(&spi->dev);
+
+ dev_dbg(&spi->dev, "lcd->power = %d\n", state->power);
+
+ before_power = state->power;
+
+ /*
+ * when lcd panel is suspend, lcd panel becomes off
+ * regardless of status.
+ */
+ ret = lms283gf05_power_set(state->ld, FB_BLANK_POWERDOWN);
+
+ return ret;
+}
+
+static int lms283gf05_resume(struct spi_device *spi)
+{
+ int ret = 0;
+ struct lms283gf05_state *state = dev_get_drvdata(&spi->dev);
+
+ dev_dbg(&spi->dev, "before_power = %d\n", before_power);
+
+ ret = lms283gf05_power_set(state->ld, before_power);
+
+ return ret;
+}
+#else
+#define lms283gf05_suspend NULL
+#define lms283gf05_resume NULL
+#endif
+
static int __devexit lms283gf05_remove(struct spi_device *spi)
{
struct lms283gf05_state *st = dev_get_drvdata(&spi->dev);
@@ -209,6 +249,8 @@ static struct spi_driver lms283gf05_driver = {
},
.probe = lms283gf05_probe,
.remove = __devexit_p(lms283gf05_remove),
+ .suspend = lms283gf05_suspend,
+ .resume = lms283gf05_resume,
};
module_spi_driver(lms283gf05_driver);
--
1.7.12.4
^ permalink raw reply related
* Re: [PATCH] lms283gf05: add suspend/resume handlers
From: Marek Vasut @ 2012-10-28 21:53 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1351439357-9843-1-git-send-email-anarsoul@gmail.com>
Dear Vasily Khoruzhick,
> Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
> ---
> drivers/video/backlight/lms283gf05.c | 42
> ++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+)
>
> diff --git a/drivers/video/backlight/lms283gf05.c
> b/drivers/video/backlight/lms283gf05.c index ea43f22..ed15752 100644
> --- a/drivers/video/backlight/lms283gf05.c
> +++ b/drivers/video/backlight/lms283gf05.c
> @@ -22,6 +22,7 @@
> struct lms283gf05_state {
> struct spi_device *spi;
> struct lcd_device *ld;
> + unsigned int power;
> };
>
> struct lms283gf05_seq {
> @@ -130,6 +131,8 @@ static int lms283gf05_power_set(struct lcd_device *ld,
> int power) struct spi_device *spi = st->spi;
> struct lms283gf05_pdata *pdata = spi->dev.platform_data;
>
> + st->power = power;
> +
> if (power <= FB_BLANK_NORMAL) {
> if (pdata)
> lms283gf05_reset(pdata->reset_gpio,
> @@ -193,6 +196,43 @@ static int __devinit lms283gf05_probe(struct
> spi_device *spi) return 0;
> }
>
> +#if defined(CONFIG_PM)
> +static unsigned int before_power;
NAK, this won't work if you have two different LCDs connected, use private data.
> +static int lms283gf05_suspend(struct spi_device *spi, pm_message_t mesg)
> +{
> + int ret = 0;
Redundant assignment.
> + struct lms283gf05_state *state = dev_get_drvdata(&spi->dev);
> +
> + dev_dbg(&spi->dev, "lcd->power = %d\n", state->power);
> +
> + before_power = state->power;
> +
> + /*
> + * when lcd panel is suspend, lcd panel becomes off
> + * regardless of status.
> + */
> + ret = lms283gf05_power_set(state->ld, FB_BLANK_POWERDOWN);
Why not just return lms...(); ?
> + return ret;
> +}
> +
> +static int lms283gf05_resume(struct spi_device *spi)
> +{
> + int ret = 0;
Redundant assignment.
> + struct lms283gf05_state *state = dev_get_drvdata(&spi->dev);
> +
> + dev_dbg(&spi->dev, "before_power = %d\n", before_power);
> +
> + ret = lms283gf05_power_set(state->ld, before_power);
> +
> + return ret;
> +}
> +#else
> +#define lms283gf05_suspend NULL
> +#define lms283gf05_resume NULL
> +#endif
> +
> static int __devexit lms283gf05_remove(struct spi_device *spi)
> {
> struct lms283gf05_state *st = dev_get_drvdata(&spi->dev);
> @@ -209,6 +249,8 @@ static struct spi_driver lms283gf05_driver = {
> },
> .probe = lms283gf05_probe,
> .remove = __devexit_p(lms283gf05_remove),
> + .suspend = lms283gf05_suspend,
> + .resume = lms283gf05_resume,
> };
>
> module_spi_driver(lms283gf05_driver);
Best regards,
Marek Vasut
^ permalink raw reply
* [GIT PULL] SH Mobile LCDC patches
From: Laurent Pinchart @ 2012-10-28 23:33 UTC (permalink / raw)
To: linux-fbdev
Hi Florian,
The following changes since commit cd9d6f10d07f26dd8a70e519c22b6b4f8a9e3e7a:
gbefb: fix compile error (2012-10-11 00:23:15 +0000)
are available in the git repository at:
git://linuxtv.org/pinchartl/fbdev.git lcdc-next
Both Paul Mundt (arch/sh maintainer) and Simon Horman (arch/arm/mach-shmobile
maintainer) have agreed to get the arch patches in through your tree.
Hideki EIRAKU (1):
fbdev: sh_mobile_lcdc: use dma_mmap_coherent
Laurent Pinchart (19):
fbdev: sh_mobile_lcdc: Get display dimensions from the channel structure
fbdev: sh_mobile_lcdc: Rename mode argument to modes
fbdev: sh_mobile_lcdc: Remove priv argument from channel and overlay
init
ARM: mach-shmobile: ag5evm: Add LCDC tx_dev field to platform data
fbdev: sh_mipi_dsi: Add channel field to platform data
ARM: mach-shmobile: Initiliaze the new sh_mipi_dsi_info channel field
fbdev: sh_mipi_dsi: Use the sh_mipi_dsi_info channel field
fbdev: sh_mipi_dsi: Use the LCDC entity default mode
fbdev: sh_mipi_dsi: Remove last reference to LCDC platform data
ARM: mach-shmobile: Remove the unused sh_mipi_dsi_info lcd_chan field
fbdev: sh_mipi_dsi: Remove the unused sh_mipi_dsi_info lcd_chan field
fbdev: sh_mobile_lcdc: Store the backlight brightness internally
ARM: mach-shmobile: mackerel: Removed unused get_brightness callback
sh: ap325rxa: Remove unused get_brightness LCDC callback
sh: ecovec24: Remove unused get_brightness LCDC callback
fbdev: sh_mobile_lcdc: Remove unused get_brightness pdata callback
ARM: mach-shmobile: ag5evm: Use the backlight API for brightness control
sh: kfr2r09: Use the backlight API for brightness control
fbdev: sh_mobile_lcdc: Make sh_mobile_lcdc_sys_bus_ops static
arch/arm/mach-shmobile/board-ag5evm.c | 198 ++++++++++++++------------
arch/arm/mach-shmobile/board-ap4evb.c | 4 +-
arch/arm/mach-shmobile/board-mackerel.c | 6 -
arch/sh/boards/mach-ap325rxa/setup.c | 6 -
arch/sh/boards/mach-ecovec24/setup.c | 6 -
arch/sh/boards/mach-kfr2r09/lcd_wqvga.c | 16 +--
arch/sh/boards/mach-kfr2r09/setup.c | 7 +-
arch/sh/include/mach-kfr2r09/mach/kfr2r09.h | 6 +-
drivers/video/sh_mipi_dsi.c | 69 ++++------
drivers/video/sh_mobile_lcdcfb.c | 74 +++++++----
drivers/video/sh_mobile_lcdcfb.h | 1 +
include/video/sh_mipi_dsi.h | 4 +-
include/video/sh_mobile_lcdc.h | 1 -
13 files changed, 192 insertions(+), 206 deletions(-)
--
Regards,
Laurent Pinchart
^ permalink raw reply
* Re: [PATCH 19/20] OMAPDSS: DISPC: remove dssdev depependency from error handler
From: Archit Taneja @ 2012-10-29 7:24 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: linux-omap, linux-fbdev
In-Reply-To: <1351070951-18616-20-git-send-email-tomi.valkeinen@ti.com>
Hi,
On Wednesday 24 October 2012 02:59 PM, Tomi Valkeinen wrote:
> The dispc error handler tries to "fix" issues by disabling and enabling
> panel. This is problematic, as we're trying to remove the dependency
> from omapdss to the omap_dss_devices. It's also racy, and doesn't really
> fix anything.
>
> This patch removes the use of omap_dss_device from the error handler,
> and just disables and enables the associated overlay manager. This
> should produce similar results as the previous solution, without using
> dssdev.
Calling APPLY functions from the DISPC driver seems a bit incorrect.
Instead of disabling/enabling the panel, can't we disable/enable the
manger by just using DISPC funcs?
Archit
^ permalink raw reply
* [PATCH 1/2] da8xx-fb: add DT support
From: Manjunathappa, Prakash @ 2012-10-29 7:33 UTC (permalink / raw)
To: linux-fbdev, devicetree-discuss
Cc: FlorianSchandinat, grant.likely, rob.herring,
davinci-linux-open-source, linux-doc, rob, s.trumtrar,
Manjunathappa, Prakash
adds device tree support for da8xx-fb driver.
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
Depends on "of: Add display helper" [1] submitted by Steffen.
Above mentioned patch under review in community and has got
review comments. Preparing this patch to keep things moving.
@Steffen: Could you please include this in your next version of
your patch.
Applies on top of LCDC cleanup patches under community review [2].
[1]:http://marc.info/?l=dri-devel&m\x134937362110396&w=2
[2]:http://marc.info/?l=linux-fbdev&m\x135036440702662&w=2
drivers/video/da8xx-fb.c | 165 +++++++++++++++++++++++++++++++++++++++++-----
1 files changed, 149 insertions(+), 16 deletions(-)
diff --git a/drivers/video/da8xx-fb.c b/drivers/video/da8xx-fb.c
index f0f21c8..8a2b0f8 100644
--- a/drivers/video/da8xx-fb.c
+++ b/drivers/video/da8xx-fb.c
@@ -36,6 +36,7 @@
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/lcm.h>
+#include <linux/of_videomode.h>
#include <video/da8xx-fb.h>
#include <asm/div64.h>
@@ -1211,12 +1212,134 @@ static unsigned int da8xxfb_pixel_clk_period(struct da8xx_fb_par *par)
return pix_clk_period_picosec;
}
+#ifdef CONFIG_OF
+static struct da8xx_lcdc_platform_data
+ *da8xx_lcdc_of_get_pdata(struct platform_device *pdev,
+ struct fb_videomode **lcdc_info)
+{
+ struct device_node *np;
+ struct da8xx_lcdc_platform_data *pdata = NULL;
+ struct lcd_ctrl_config *lcd_cfg;
+ struct fb_videomode *panel_data = NULL;
+ u32 data;
+ int ret;
+
+ pdata = pdev->dev.platform_data;
+ if (!pdata) {
+ pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
+ if (!pdata) {
+ dev_err(&pdev->dev, "Failed to allocate memory for struct da8xx_lcdc_platform_data\n");
+ goto nodata;
+ }
+ }
+
+ np = pdev->dev.of_node;
+ if (!np)
+ goto nodata;
+
+ *lcdc_info = devm_kzalloc(&pdev->dev, sizeof(struct fb_videomode),
+ GFP_KERNEL);
+ if (!*lcdc_info) {
+ dev_err(&pdev->dev, "Failed to allocate memory for struct fb_videomode\n");
+ pdata = NULL;
+ goto nodata;
+ }
+ panel_data = *lcdc_info;
+
+ lcd_cfg = devm_kzalloc(&pdev->dev, sizeof(struct lcd_ctrl_config),
+ GFP_KERNEL);
+ if (!lcd_cfg) {
+ dev_err(&pdev->dev, "Failed to allocate memory for struct lcd_ctrl_config\n");
+ pdata = NULL;
+ goto nodata;
+ }
+ pdata->controller_data = lcd_cfg;
+
+ ret = of_get_fb_videomode(np, panel_data, 0);
+ if (ret) {
+ dev_err(&pdev->dev, "fb videomode data not specified\n");
+ pdata = NULL;
+ goto nodata;
+ }
+ /* Pixel clock is expected in Hertz */
+ panel_data->pixclock = PICOS2KHZ(panel_data->pixclock) * 1000;
+
+ /* Required properties */
+ ret = of_property_read_u32(np, "panel-shade", &data);
+ if (ret) {
+ dev_err(&pdev->dev, "panel-shade not specified\n");
+ pdata = NULL;
+ goto nodata;
+ }
+ lcd_cfg->panel_shade = data;
+
+ ret = of_property_read_u32(np, "bpp", &data);
+ if (ret) {
+ dev_err(&pdev->dev, "BPP of panel not specified\n");
+ pdata = NULL;
+ goto nodata;
+ }
+ lcd_cfg->bpp = data;
+
+ /* Optional properties */
+ ret = of_property_read_u32(np, "ac-bias", &data);
+ if (!ret)
+ lcd_cfg->ac_bias = data;
+
+ ret = of_property_read_u32(np, "ac-bias-intrpt", &data);
+ if (!ret)
+ lcd_cfg->ac_bias_intrpt = data;
+
+ ret = of_property_read_u32(np, "dma-burst-sz", &data);
+ if (!ret)
+ lcd_cfg->dma_burst_sz = data;
+
+ ret = of_property_read_u32(np, "fdd", &data);
+ if (!ret)
+ lcd_cfg->fdd = data;
+
+ ret = of_property_read_u32(np, "tft-alt-mode", &data);
+ if (!ret)
+ lcd_cfg->tft_alt_mode = data;
+
+ ret = of_property_read_u32(np, "stn-565-mode", &data);
+ if (!ret)
+ lcd_cfg->stn_565_mode = data;
+
+ ret = of_property_read_u32(np, "mono-8bit-mode", &data);
+ if (!ret)
+ lcd_cfg->mono_8bit_mode = data;
+
+ ret = of_property_read_u32(np, "sync-edge", &data);
+ if (!ret)
+ lcd_cfg->sync_edge = data;
+
+ ret = of_property_read_u32(np, "raster-order", &data);
+ if (!ret)
+ lcd_cfg->raster_order = data;
+
+ ret = of_property_read_u32(np, "fifo-threshold", &data);
+ if (!ret)
+ lcd_cfg->fifo_th = data;
+
+ pdev->dev.platform_data = pdata;
+nodata:
+ return pdata;
+}
+#else
+static struct da8xx_lcdc_platform_data
+ *da8xx_lcdc_of_get_pdata(struct platform_device *pdev,
+ struct fb_videomode **lcdc_info)
+{
+ return pdev->dev.platform_data;
+}
+#endif
+
static int __devinit fb_probe(struct platform_device *device)
{
- struct da8xx_lcdc_platform_data *fb_pdata - device->dev.platform_data;
+ struct da8xx_lcdc_platform_data *fb_pdata = NULL;
struct lcd_ctrl_config *lcd_cfg;
- struct fb_videomode *lcdc_info;
+ struct fb_videomode *lcdc_info = NULL;
struct fb_info *da8xx_fb_info;
struct clk *fb_clk = NULL;
struct da8xx_fb_par *par;
@@ -1224,6 +1347,7 @@ static int __devinit fb_probe(struct platform_device *device)
int ret, i;
unsigned long ulcm;
+ fb_pdata = da8xx_lcdc_of_get_pdata(device, &lcdc_info);
if (fb_pdata = NULL) {
dev_err(&device->dev, "Can not get platform data\n");
return -ENOENT;
@@ -1274,20 +1398,22 @@ static int __devinit fb_probe(struct platform_device *device)
break;
}
- for (i = 0, lcdc_info = known_lcd_panels;
- i < ARRAY_SIZE(known_lcd_panels);
- i++, lcdc_info++) {
- if (strcmp(fb_pdata->type, lcdc_info->name) = 0)
- break;
- }
+ if (device->dev.of_node = NULL) {
+ for (i = 0, lcdc_info = known_lcd_panels;
+ i < ARRAY_SIZE(known_lcd_panels);
+ i++, lcdc_info++) {
+ if (strcmp(fb_pdata->type, lcdc_info->name) = 0)
+ break;
+ }
- if (i = ARRAY_SIZE(known_lcd_panels)) {
- dev_err(&device->dev, "GLCD: No valid panel found\n");
- ret = -ENODEV;
- goto err_pm_runtime_disable;
- } else
- dev_info(&device->dev, "GLCD: Found %s panel\n",
- fb_pdata->type);
+ if (i = ARRAY_SIZE(known_lcd_panels)) {
+ dev_err(&device->dev, "GLCD: No valid panel found\n");
+ ret = -ENODEV;
+ goto err_pm_runtime_disable;
+ } else
+ dev_info(&device->dev, "GLCD: Found %s panel\n",
+ fb_pdata->type);
+ }
lcd_cfg = (struct lcd_ctrl_config *)fb_pdata->controller_data;
@@ -1577,6 +1703,12 @@ static int fb_resume(struct platform_device *dev)
#define fb_resume NULL
#endif
+static const struct of_device_id da830_lcdc_of_match[] = {
+ {.compatible = "ti,da830-lcd", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, da830_lcdc_of_match);
+
static struct platform_driver da8xx_fb_driver = {
.probe = fb_probe,
.remove = __devexit_p(fb_remove),
@@ -1585,6 +1717,7 @@ static struct platform_driver da8xx_fb_driver = {
.driver = {
.name = DRIVER_NAME,
.owner = THIS_MODULE,
+ .of_match_table = of_match_ptr(da830_lcdc_of_match),
},
};
--
1.7.0.4
^ permalink raw reply related
* [PATCH 2/2] video: da8xx-fb: add device tree binding information
From: Manjunathappa, Prakash @ 2012-10-29 7:33 UTC (permalink / raw)
To: linux-fbdev, devicetree-discuss
Cc: FlorianSchandinat, grant.likely, rob.herring,
davinci-linux-open-source, linux-doc, rob, s.trumtrar,
Manjunathappa, Prakash
In-Reply-To: <1351495266-1202-1-git-send-email-prakash.pm@ti.com>
Signed-off-by: Manjunathappa, Prakash <prakash.pm@ti.com>
---
Documentation/devicetree/bindings/fb/da8xx-fb.txt | 86 +++++++++++++++++++++
1 files changed, 86 insertions(+), 0 deletions(-)
create mode 100644 Documentation/devicetree/bindings/fb/da8xx-fb.txt
diff --git a/Documentation/devicetree/bindings/fb/da8xx-fb.txt b/Documentation/devicetree/bindings/fb/da8xx-fb.txt
new file mode 100644
index 0000000..3fc2ef9
--- /dev/null
+++ b/Documentation/devicetree/bindings/fb/da8xx-fb.txt
@@ -0,0 +1,86 @@
+* Texas Instruments DaVinci da8xx-fb
+
+This file provides information of da830-fb device node.
+
+Required properties:
+- compatible : "ti,da830-lcd" : for DA830, DA850 and am335x platforms
+- reg : Offset and length of the register set for the device.
+- interrupts : standard interrupt property.
+- interrupt-parent : The phandle for the interrupt controller that
+ services interrupts for this device.
+- panel_shade : panel shade for-ex MONOCHROME, PASSIVE, ACTIVE.
+- bpp : bits per pixel resolution.
+- display-timings: Panel timing information.
+
+Optional properties:
+- ac-bias : AC Bias Pin Frequency. This value defines the
+ number of Line Clock (LCD_HSYNC) cycles to count
+ before transitioning signal LCD_AC_ENB_CS. This
+ output may be used to periodically invert the
+ polarity of the power supply in order to prevent a
+ display DC charge build-up on the LCD panel.
+
+- ac-bias-intrpt : This value is used to specify the number of AC
+ Bias(LCD_AC_ENB_CS) output transition counts
+ before setting the AC bias interrupt bit in
+ register LCD_STAT. This counter is stopped when
+ the interrupt is set and remains stopped until the
+ AC bias interrupt status is cleared. A value of
+ zero will not produce an interrupt.
+
+- tft-alt-mode : TFT Alternative Signal Mapping
+- stn-565-mode : 12-Bit-Per-Pixel (5-6-5) Mode. This is only
+ available in passive-color (STN) mode when 12 BPP
+ is specified in the palette.
+
+- mono-8bit-mode : Mono 8-bit Mode
+
+- sync-edge : This determines whether the HSYNC/VSYNC is driven
+ on the rising or falling edge of the pixel clock
+
+- raster-order : Decides data order, if 0 frame buffer data is
+ ordered from least-to-most significant bit/nibble/
+ byte/word/d-word else most-to- least significant..
+
+- panel : panel name along manufacturer name.
+- dma-burst-sz : Burst Size setting for DMA transfers
+- fifo-threshold : DMA FIFO threshold. The input FIFO becomes ready
+ so that the Raster controller can start reading
+ its content only when the number of dwords (1
+ dword is 4 bytes) specified by TH_FIFO_READY have
+ been loaded by the DMA from the frame buffer to
+ the input FIFO.
+
+- fdd : FIFO DMA Request Delay. Encoded value used to
+ specify the number of clocks the input FIFO DMA
+ request should be disabled. The delay clock count
+ starts after 16 words are loaded into the input
+ FIFO.
+
+Example for da850-evm:
+ lcd0: lcd@1e13000 {
+ compatible = "ti,da8xx-lcd";
+ reg = <0x213000 0x1000>;
+ clock-frequency = <150000000>;
+ interrupts = <52>;
+ interrupt-parent = <&intc>;
+ panel_shade = <1>;
+ bpp = <16>;
+ display-timings {
+ default-timing = <&timing0>;
+ timing0: 480x272p53 {
+ clock = <7833600>;
+ hactive = <480>;
+ vactive = <272>;
+ hfront-porch = <2>;
+ hback-porch = <2>;
+ hsync-len = <41>;
+ vback-porch = <3>;
+ vfront-porch = <3>;
+ vsync-len = <10>;
+ hsync-active-high;
+ vsync-active-high;
+ };
+ };
+ };
+
--
1.7.0.4
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox