summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Green <andy.green@linaro.org>2011-06-17 09:21:58 +0100
committerAndy Green <andy.green@linaro.org>2011-06-17 09:21:58 +0100
commit310fa5452c2411d9c0750243f8d0af91b7cb2d90 (patch)
treefd14c07c844f1af6218026c293a3e86490d9aed8
parent2b891d083ae87e093c0039a56a03c29f2947c2a5 (diff)
sgx debug drm modesettingandroid-2.6.38-2011-06
Signed-off-by: Andy Green <andy.green@linaro.org>
-rw-r--r--drivers/gpu/drm/omap/omap_connector.c4
-rw-r--r--drivers/video/omap2/dss/display.c3
-rw-r--r--drivers/video/omap2/dss/hdmi.c67
-rw-r--r--drivers/video/omap2/dss/hdmi_omap4_panel.c11
-rw-r--r--drivers/video/omap2/omapfb/omapfb-main.c9
5 files changed, 70 insertions, 24 deletions
diff --git a/drivers/gpu/drm/omap/omap_connector.c b/drivers/gpu/drm/omap/omap_connector.c
index 7eaa04c3698..7f6b41ed4ac 100644
--- a/drivers/gpu/drm/omap/omap_connector.c
+++ b/drivers/gpu/drm/omap/omap_connector.c
@@ -93,13 +93,15 @@ enum drm_connector_status omap_connector_detect(
struct omap_dss_driver *dssdrv = dssdev->driver;
enum drm_connector_status ret;
+ pr_err("omap_connector_detect\n");
+
if (dssdrv->is_detected(dssdev, force)) {
ret = connector_status_connected;
} else {
ret = connector_status_disconnected;
}
- DBG("%s: %d (force=%d)", omap_connector->dssdev->name, ret, force);
+ pr_err("%s: %d (force=%d)", omap_connector->dssdev->name, ret, force);
return ret;
}
diff --git a/drivers/video/omap2/dss/display.c b/drivers/video/omap2/dss/display.c
index 47950e761d0..cf29bac27ad 100644
--- a/drivers/video/omap2/dss/display.c
+++ b/drivers/video/omap2/dss/display.c
@@ -656,6 +656,9 @@ static void notify_worker(struct work_struct *work)
struct notify_work *nw =
container_of(work, struct notify_work, work);
struct omap_dss_device *dssdev = nw->dssdev;
+
+ pr_err("display.c: notify_worker: 0x%x\n", nw->evt);
+
blocking_notifier_call_chain(&dssdev->notifier, nw->evt, dssdev);
kfree(work);
}
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index dc809c46ef8..edcaa9f7574 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -52,7 +52,7 @@ static struct {
struct hdmi_config cfg;
} hdmi = {
.code = 4, /*setting default value of 640 480 VGA*/
- .mode = 0,
+ .mode = HDMI_HDMI,
};
/*
@@ -369,6 +369,8 @@ static int hdmi_core_ddc_edid(u8 *pedid, int ext)
char checksum = 0;
u32 offset = 0;
+ pr_err("**** hdmi_core_ddc_edid in\n");
+
/* Turn on CLK for DDC */
REG_FLD_MOD(HDMI_CORE_AV_DPD, 0x7, 2, 0);
@@ -386,7 +388,7 @@ static int hdmi_core_ddc_edid(u8 *pedid, int ext)
/* HDMI_CORE_DDC_STATUS_IN_PROG */
if (hdmi_wait_for_bit_change(HDMI_CORE_DDC_STATUS,
4, 4, 0) != 0) {
- DSSERR("Failed to program DDC\n");
+ pr_err("Failed to program DDC\n");
return -ETIMEDOUT;
}
@@ -396,7 +398,7 @@ static int hdmi_core_ddc_edid(u8 *pedid, int ext)
/* HDMI_CORE_DDC_STATUS_IN_PROG */
if (hdmi_wait_for_bit_change(HDMI_CORE_DDC_STATUS,
4, 4, 0) != 0) {
- DSSERR("Failed to program DDC\n");
+ pr_err("Failed to program DDC\n");
return -ETIMEDOUT;
}
@@ -426,12 +428,12 @@ static int hdmi_core_ddc_edid(u8 *pedid, int ext)
/* HDMI_CORE_DDC_STATUS_BUS_LOW */
if (REG_GET(HDMI_CORE_DDC_STATUS, 6, 6) == 1) {
- DSSWARN("I2C Bus Low?\n");
+ pr_err("I2C Bus Low?\n");
return -EIO;
}
/* HDMI_CORE_DDC_STATUS_NO_ACK */
if (REG_GET(HDMI_CORE_DDC_STATUS, 5, 5) == 1) {
- DSSWARN("I2C No Ack\n");
+ pr_err("I2C No Ack\n");
return -EIO;
}
@@ -448,14 +450,18 @@ static int hdmi_core_ddc_edid(u8 *pedid, int ext)
}
}
- for (j = 0; j < 128; j++)
+ for (j = 0; j < 128; j++) {
checksum += pedid[j];
+ pr_err("%02X\n", pedid[j]);
+ }
if (checksum != 0) {
- DSSERR("E-EDID checksum failed!!\n");
+ pr_err("E-EDID checksum failed!!\n");
return -EIO;
}
+ pr_err("return OK\n");
+
return 0;
}
@@ -492,12 +498,17 @@ static int get_timings_index(void)
{
int code;
+ pr_err("get_timings_index hdmi.mode=%d hdmi.code=%d\n", hdmi.mode, hdmi.code);
+
if (hdmi.mode == 0)
code = code_vesa[hdmi.code];
else
code = code_cea[hdmi.code];
+ pr_err("get_timings_index: code = %d\n", code);
+
if (code == -1) {
+
/* HDMI code 4 corresponds to 640 * 480 VGA */
hdmi.code = 4;
/* DVI mode 1 corresponds to HDMI 0 to DVI */
@@ -514,10 +525,11 @@ static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing)
int timing_vsync = 0, timing_hsync = 0;
struct omap_video_timings temp;
struct hdmi_cm cm = {-1};
- DSSDBG("hdmi_get_code\n");
+ pr_err("hdmi_get_code\n");
for (i = 0; i < OMAP_HDMI_TIMINGS_NB; i++) {
temp = cea_vesa_timings[i].timings;
+
if ((temp.pixel_clock == timing->pixel_clock) &&
(temp.x_res == timing->x_res) &&
(temp.y_res == timing->y_res)) {
@@ -527,7 +539,7 @@ static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing)
temp_vsync = temp.vfp + temp.vsw + temp.vbp;
timing_vsync = timing->vfp + timing->vsw + timing->vbp;
- DSSDBG("temp_hsync = %d , temp_vsync = %d"
+ pr_err("temp_hsync = %d , temp_vsync = %d"
"timing_hsync = %d, timing_vsync = %d\n",
temp_hsync, temp_hsync,
timing_hsync, timing_vsync);
@@ -540,7 +552,7 @@ static struct hdmi_cm hdmi_get_code(struct omap_video_timings *timing)
cm.mode = HDMI_HDMI;
else
cm.mode = HDMI_DVI;
- DSSDBG("Hdmi_code = %d mode = %d\n",
+ pr_err("Hdmi_code = %d mode = %d\n",
cm.code, cm.mode);
break;
}
@@ -564,7 +576,7 @@ static void hdmi_read_edid()
hdmi.edid_set = true;
}
} else {
- DSSWARN("failed to read E-EDID\n");
+ pr_err("failed to read E-EDID\n");
}
}
@@ -1018,14 +1030,15 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
p = &dssdev->panel.timings;
- DSSDBG("hdmi_power_on x_res= %d y_res = %d\n",
+ pr_err("hdmi_power_on x_res= %d y_res = %d\n",
dssdev->panel.timings.x_res,
dssdev->panel.timings.y_res);
if (!hdmi.edid_set) {
- DSSDBG("Read EDID as no EDID is not set on poweron\n");
+ pr_err("Read EDID as no EDID is not set on poweron\n");
hdmi_read_edid();
- }
+ } else
+ pr_err("EDID set at poweron skip reading EDID\n");
code = get_timings_index();
dssdev->panel.timings = cea_vesa_timings[code].timings;
@@ -1040,8 +1053,14 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
hdmi_wp_video_start(0);
if (dirty) {
- omap_dss_notify(dssdev, OMAP_DSS_SIZE_CHANGE);
- }
+ bool hdmi_panel_is_detected(struct omap_dss_device *dssdev, bool force);
+
+ pr_err("hdmi_power_on calling omap_dss_notify(dssdev, OMAP_DSS_SIZE_CHANGE);\n");
+ hdmi_panel_is_detected(dssdev, 1);
+ hdmi.code = 31;
+ hdmi.mode = 1;
+ omap_dss_notify(dssdev, OMAP_DSS_SIZE_CHANGE);
+ }
/* config the PLL and PHY first */
r = hdmi_pll_program(&pll_data);
@@ -1105,8 +1124,10 @@ bool omapdss_hdmi_is_detected(struct omap_dss_device *dssdev, bool force)
u32 r;
/* If EDID has already been read, we have HDMI connected */
- if (hdmi.edid_set)
+ if (hdmi.edid_set) {
+ pr_err("omapdss_hdmi_is_detected, already seen set\n");
return true;
+ }
r = hdmi_read_reg(HDMI_CORE_SYS_SYS_STAT);
@@ -1114,12 +1135,14 @@ bool omapdss_hdmi_is_detected(struct omap_dss_device *dssdev, bool force)
* right after reporting it's connected, so try again if probe
* failed and force is enabled */
if (!(r & 0x2) && (force)) {
- DSSDBG("Fail to detect the connector and force is enabled, "
+ pr_err("Fail to detect the connector and force is enabled, "
"trying at least one more time\n");
msleep(2000);
r = hdmi_read_reg(HDMI_CORE_SYS_SYS_STAT);
}
+ pr_err("*** omapdss_hdmi_is_detected returns %d\n", !!(r & 2));
+
return !!(r & 0x2);
}
@@ -1138,6 +1161,8 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
{
struct hdmi_cm cm;
+ pr_err("omapdss_hdmi_display_check_timing\n");
+
cm = hdmi_get_code(timings);
if (cm.code == -1) {
return -EINVAL;
@@ -1151,6 +1176,8 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev)
{
struct hdmi_cm cm;
+ pr_err("omapdss_hdmi_display_set_timing\n");
+
hdmi.custom_set = 1;
cm = hdmi_get_code(&dssdev->panel.timings);
hdmi.code = cm.code;
@@ -1163,7 +1190,7 @@ int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
{
int r = 0;
- DSSDBG("ENTER hdmi_display_enable\n");
+ pr_err("ENTER hdmi_display_enable\n");
mutex_lock(&hdmi.lock);
@@ -1202,7 +1229,7 @@ err0:
void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
{
- DSSDBG("Enter hdmi_display_disable\n");
+ pr_err("Enter hdmi_display_disable\n");
mutex_lock(&hdmi.lock);
diff --git a/drivers/video/omap2/dss/hdmi_omap4_panel.c b/drivers/video/omap2/dss/hdmi_omap4_panel.c
index cae04d12e12..8ee7d2e5357 100644
--- a/drivers/video/omap2/dss/hdmi_omap4_panel.c
+++ b/drivers/video/omap2/dss/hdmi_omap4_panel.c
@@ -32,6 +32,8 @@ static struct {
struct mutex hdmi_lock;
} hdmi;
+#undef DSSDBG
+#define DSSDBG pr_err
static int hdmi_panel_probe(struct omap_dss_device *dssdev)
{
@@ -143,11 +145,14 @@ err:
return r;
}
-static bool hdmi_panel_is_detected(struct omap_dss_device *dssdev, bool force)
+bool hdmi_panel_is_detected(struct omap_dss_device *dssdev, bool force)
{
+ pr_err("hdmi_panel_is_detected, force=%d\n", force);
return omapdss_hdmi_is_detected(dssdev, force);
}
+EXPORT_SYMBOL_GPL(hdmi_panel_is_detected);
+
static int hdmi_get_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
{
return omapdss_hdmi_get_edid(dssdev, buf, len);
@@ -163,7 +168,7 @@ static void hdmi_get_timings(struct omap_dss_device *dssdev,
mutex_unlock(&hdmi.hdmi_lock);
}
-static void hdmi_set_timings(struct omap_dss_device *dssdev,
+void hdmi_set_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
{
DSSDBG("hdmi_set_timings\n");
@@ -180,6 +185,8 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
mutex_unlock(&hdmi.hdmi_lock);
}
+EXPORT_SYMBOL_GPL(hdmi_set_timings);
+
static int hdmi_check_timings(struct omap_dss_device *dssdev,
struct omap_video_timings *timings)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index e6a4987f39e..892e2af399d 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1912,7 +1912,7 @@ static void size_notify(struct fb_info *fbi, int w, int h)
int orig_flags;
int new_size = (w * var.bits_per_pixel >> 3) * h;
- DBG("size_notify: %dx%d\n", w, h);
+ pr_err("omapfb_main.c: size_notify: %dx%d\n", w, h);
var.activate |= FB_ACTIVATE_FORCE | FB_ACTIVATE_ALL | FB_ACTIVATE_NOW;
var.xres = w;
@@ -1963,6 +1963,8 @@ static int omapfb_notifier(struct notifier_block *nb,
int keep = false;
int i;
+ pr_err("**** omapfb_notifier evt 0x%lX\n", evt);
+
/* figure out if this event pertains to this omapfb device:
*/
for (i = 0; i < fbdev->num_managers; i++) {
@@ -1981,6 +1983,8 @@ static int omapfb_notifier(struct notifier_block *nb,
case OMAP_DSS_SIZE_CHANGE: {
u16 w, h;
dssdev->driver->get_resolution(dssdev, &w, &h);
+
+ pr_err("omapfb_notifier: OMAP_DSS_SIZE_CHANGE:%d %d\n", w, h);
for (i = 0; i < fbdev->num_fbs; i++)
size_notify(fbdev->fbs[i], w, h);
break;
@@ -2361,6 +2365,9 @@ static int omapfb_probe(struct platform_device *pdev)
notifier = kzalloc(sizeof(struct omapfb_notifier_block), GFP_KERNEL);
notifier->notifier.notifier_call = omapfb_notifier;
notifier->fbdev = fbdev;
+
+ pr_err("****** omapfb_probe: adding notifier\n");
+
omap_dss_add_notify(dssdev, &notifier->notifier);
}