From fd3cd7ee126b2c3768d5253e12ac51868b0652f1 Mon Sep 17 00:00:00 2001 From: Mythri P K Date: Wed, 11 Apr 2012 16:38:07 +0530 Subject: OMAPDSS: HDMI: Fix AVI infoframe bug ti_hdmi_4xxx_basic_configure() is supposed to initialize the AVI infoframe data in the ip_data container. However, the function actually takes a copy of the infoframe from the ip_data, and then goes on initializing that copy. The initialized data is never copied back to the ip_data container, thus the infoframe in ip_data is left always zero. Afaik, this doesn't really cause any issues in the current mainline, as we don't use the advanced features offered by the AVI infoframe. This patch fixes the initialization of the AVI infoframe. Signed-off-by: Mythri P K [tomi.valkeinen@ti.com: updated the description] Signed-off-by: Tomi Valkeinen --- drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c | 42 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 22 deletions(-) (limited to 'drivers/video/omap2/dss') diff --git a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c index e242ed85cb0..3dfe00956a4 100644 --- a/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c +++ b/drivers/video/omap2/dss/ti_hdmi_4xxx_ip.c @@ -779,16 +779,14 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) struct omap_video_timings video_timing; struct hdmi_video_format video_format; /* HDMI core */ - struct hdmi_core_infoframe_avi avi_cfg = ip_data->avi_cfg; + struct hdmi_core_infoframe_avi *avi_cfg = &ip_data->avi_cfg; struct hdmi_core_video_config v_core_cfg; struct hdmi_core_packet_enable_repeat repeat_cfg; struct hdmi_config *cfg = &ip_data->cfg; hdmi_wp_init(&video_timing, &video_format); - hdmi_core_init(&v_core_cfg, - &avi_cfg, - &repeat_cfg); + hdmi_core_init(&v_core_cfg, avi_cfg, &repeat_cfg); hdmi_wp_video_init_format(&video_format, &video_timing, cfg); @@ -822,24 +820,24 @@ void ti_hdmi_4xxx_basic_configure(struct hdmi_ip_data *ip_data) * configure packet * info frame video see doc CEA861-D page 65 */ - avi_cfg.db1_format = HDMI_INFOFRAME_AVI_DB1Y_RGB; - avi_cfg.db1_active_info = - HDMI_INFOFRAME_AVI_DB1A_ACTIVE_FORMAT_OFF; - avi_cfg.db1_bar_info_dv = HDMI_INFOFRAME_AVI_DB1B_NO; - avi_cfg.db1_scan_info = HDMI_INFOFRAME_AVI_DB1S_0; - avi_cfg.db2_colorimetry = HDMI_INFOFRAME_AVI_DB2C_NO; - avi_cfg.db2_aspect_ratio = HDMI_INFOFRAME_AVI_DB2M_NO; - avi_cfg.db2_active_fmt_ar = HDMI_INFOFRAME_AVI_DB2R_SAME; - avi_cfg.db3_itc = HDMI_INFOFRAME_AVI_DB3ITC_NO; - avi_cfg.db3_ec = HDMI_INFOFRAME_AVI_DB3EC_XVYUV601; - avi_cfg.db3_q_range = HDMI_INFOFRAME_AVI_DB3Q_DEFAULT; - avi_cfg.db3_nup_scaling = HDMI_INFOFRAME_AVI_DB3SC_NO; - avi_cfg.db4_videocode = cfg->cm.code; - avi_cfg.db5_pixel_repeat = HDMI_INFOFRAME_AVI_DB5PR_NO; - avi_cfg.db6_7_line_eoftop = 0; - avi_cfg.db8_9_line_sofbottom = 0; - avi_cfg.db10_11_pixel_eofleft = 0; - avi_cfg.db12_13_pixel_sofright = 0; + avi_cfg->db1_format = HDMI_INFOFRAME_AVI_DB1Y_RGB; + avi_cfg->db1_active_info = + HDMI_INFOFRAME_AVI_DB1A_ACTIVE_FORMAT_OFF; + avi_cfg->db1_bar_info_dv = HDMI_INFOFRAME_AVI_DB1B_NO; + avi_cfg->db1_scan_info = HDMI_INFOFRAME_AVI_DB1S_0; + avi_cfg->db2_colorimetry = HDMI_INFOFRAME_AVI_DB2C_NO; + avi_cfg->db2_aspect_ratio = HDMI_INFOFRAME_AVI_DB2M_NO; + avi_cfg->db2_active_fmt_ar = HDMI_INFOFRAME_AVI_DB2R_SAME; + avi_cfg->db3_itc = HDMI_INFOFRAME_AVI_DB3ITC_NO; + avi_cfg->db3_ec = HDMI_INFOFRAME_AVI_DB3EC_XVYUV601; + avi_cfg->db3_q_range = HDMI_INFOFRAME_AVI_DB3Q_DEFAULT; + avi_cfg->db3_nup_scaling = HDMI_INFOFRAME_AVI_DB3SC_NO; + avi_cfg->db4_videocode = cfg->cm.code; + avi_cfg->db5_pixel_repeat = HDMI_INFOFRAME_AVI_DB5PR_NO; + avi_cfg->db6_7_line_eoftop = 0; + avi_cfg->db8_9_line_sofbottom = 0; + avi_cfg->db10_11_pixel_eofleft = 0; + avi_cfg->db12_13_pixel_sofright = 0; hdmi_core_aux_infoframe_avi_config(ip_data); -- cgit v1.2.3-70-g09d2 From db680c65156083c8780044f46f7a74544fcb3ce2 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 27 Aug 2013 14:11:48 +0300 Subject: OMAPDSS: HDMI: Fix possible NULL reference Commit 5391e87d1259 (OMAPDSS: remove dispc's dependency to VENC/HDMI) introduced a possible NULL reference bug in the HDMI driver when setting timings. In practice the bug shouldn't happen, as the timings have been verified earlier, and thus the timings should always be ok. Fix the possible issue by moving the use of the timings pointer inside the NULL check. Signed-off-by: Tomi Valkeinen Reported-by: Dan Carpenter --- drivers/video/omap2/dss/hdmi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/video/omap2/dss') diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c index 44a885b9282..ea97854308f 100644 --- a/drivers/video/omap2/dss/hdmi.c +++ b/drivers/video/omap2/dss/hdmi.c @@ -666,10 +666,11 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev, hdmi.ip_data.cfg.cm = cm; t = hdmi_get_timings(); - if (t != NULL) + if (t != NULL) { hdmi.ip_data.cfg = *t; - dispc_set_tv_pclk(t->timings.pixel_clock * 1000); + dispc_set_tv_pclk(t->timings.pixel_clock * 1000); + } mutex_unlock(&hdmi.lock); } -- cgit v1.2.3-70-g09d2 From 3825ce5a9bb6ac1f847828ba2b283c9c7aa77eb6 Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Tue, 27 Aug 2013 14:28:03 +0300 Subject: OMAPDSS: fix WARN_ON in 'alpha_blending_enabled' sysfs file The code handling 'alpha_blending_enabled' sysfs file contains WARN_ONs in case the feature is not supported on the current platform. Even though only root can write to the file, anyone can read it, thus causing the kernel to get tainted and printing an ugly warning. Instead of having WARN_ONs, return a proper error if the feature is not supported. Signed-off-by: Tomi Valkeinen Reported-by: Russell King - ARM Linux --- drivers/video/omap2/dss/manager-sysfs.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'drivers/video/omap2/dss') diff --git a/drivers/video/omap2/dss/manager-sysfs.c b/drivers/video/omap2/dss/manager-sysfs.c index de7e7b5b1b7..37b59fe28dc 100644 --- a/drivers/video/omap2/dss/manager-sysfs.c +++ b/drivers/video/omap2/dss/manager-sysfs.c @@ -285,9 +285,10 @@ static ssize_t manager_alpha_blending_enabled_show( { struct omap_overlay_manager_info info; - mgr->get_manager_info(mgr, &info); + if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) + return -ENODEV; - WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)); + mgr->get_manager_info(mgr, &info); return snprintf(buf, PAGE_SIZE, "%d\n", info.partial_alpha_enabled); @@ -301,7 +302,8 @@ static ssize_t manager_alpha_blending_enabled_store( bool enable; int r; - WARN_ON(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)); + if(!dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) + return -ENODEV; r = strtobool(buf, &enable); if (r) -- cgit v1.2.3-70-g09d2