From 346fea63a8d25644a5ad06ecd98d6a4747c63885 Mon Sep 17 00:00:00 2001 From: Robert Foss Date: Thu, 14 Apr 2016 10:34:16 -0400 Subject: include/drm: Reword debug categories comment. The debug category comment mentions 4 categories, but more than 4 categories are listed. Let's change the wording to something a bit more generic. Signed-off-by: Robert Foss Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1460644456-9752-1-git-send-email-robert.foss@collabora.com --- include/drm/drmP.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/drm/drmP.h b/include/drm/drmP.h index 3c8422c69572..5de4cff05ac9 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h @@ -90,7 +90,7 @@ struct reservation_object; struct dma_buf_attachment; /* - * 4 debug categories are defined: + * The following categories are defined: * * CORE: Used in the generic drm code: drm_ioctl.c, drm_mm.c, drm_memory.c, ... * This is the category used by the DRM_DEBUG() macro. -- cgit v1.2.3 From 59f7c0fa325e5661188a174a435ea4925543985b Mon Sep 17 00:00:00 2001 From: Jim Bride Date: Thu, 14 Apr 2016 10:18:35 -0700 Subject: drm/edid: Add drm_edid_get_monitor_name() In order to include monitor name information in debugfs output we needed to add a function that would extract the monitor name from the EDID, and that function needed to reside in the file where the rest of the EDID helper functions are implemented. v2: Refactor to have drm_edid_get_monitor_name() and drm_edid_to_eld() use a common helper function to extract the monitor name from the edid. [Jani] + rebase. v3: Minor changes suggested by Jani + rebase. v4: Few more minor changes suggested by Jani + rebase. cc: dri-devel@lists.freedesktop.org cc: Jani Nikula Reviewed-by: Jani Nikula Signed-off-by: Jim Bride Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1460654317-31288-1-git-send-email-jim.bride@linux.intel.com --- include/drm/drm_crtc.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 8cb377c5eb93..6d4684242a00 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2500,6 +2500,8 @@ extern int drm_edid_header_is_valid(const u8 *raw_edid); extern bool drm_edid_block_valid(u8 *raw_edid, int block, bool print_bad_edid, bool *edid_corrupt); extern bool drm_edid_is_valid(struct edid *edid); +extern void drm_edid_get_monitor_name(struct edid *edid, char *name, + int buflen); extern struct drm_tile_group *drm_mode_create_tile_group(struct drm_device *dev, char topology[8]); -- cgit v1.2.3 From 644a80508f918e488aad70814b65b7007438ef4c Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Tue, 22 Mar 2016 14:10:33 +0000 Subject: drm: fix lut value extraction function When extracting the value at full precision (16 bits), no need to round the value. This was spotted by Jani when running sparse. Unfortunately this fix doesn't get rid of the warning. Signed-off-by: Lionel Landwerlin Reported-by: Jani Nikula Cc: Daniel Stone Cc: Daniel Vetter Cc: Matt Roper Cc: dri-devel@lists.freedesktop.org Fixes: 5488dc16fde7 ("drm: introduce pipe color correction properties") Reviewed-by: Emil Velikov Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1458655833-19547-1-git-send-email-lionel.g.landwerlin@intel.com --- include/drm/drm_crtc.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 6d4684242a00..a6fbc9e5e896 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2592,10 +2592,14 @@ static inline struct drm_property *drm_property_find(struct drm_device *dev, static inline uint32_t drm_color_lut_extract(uint32_t user_input, uint32_t bit_precision) { - uint32_t val = user_input + (1 << (16 - bit_precision - 1)); + uint32_t val = user_input; uint32_t max = 0xffff >> (16 - bit_precision); - val >>= 16 - bit_precision; + /* Round only if we're not using full precision. */ + if (bit_precision < 16) { + val += 1UL << (16 - bit_precision - 1); + val >>= 16 - bit_precision; + } return clamp_val(val, 0, max); } -- cgit v1.2.3 From 54d2c2da0946368b96b63e6daed7920f3681243e Mon Sep 17 00:00:00 2001 From: Alexey Brodkin Date: Tue, 19 Apr 2016 15:24:51 +0300 Subject: drm: Introduce drm_connector_register_all() helper As a pair to already existing drm_connector_unregister_all() we're adding generic implementation of what is already done in some drivers. Once this helper is implemented we'll be ready to switch existing driver-specific implementations with the generic one. Signed-off-by: Alexey Brodkin Cc: Daniel Vetter Cc: David Airlie Cc: Boris Brezillon Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1461068693-11260-2-git-send-email-abrodkin@synopsys.com --- include/drm/drm_crtc.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index a6fbc9e5e896..6f43f9487aee 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -2249,7 +2249,8 @@ static inline unsigned drm_connector_index(struct drm_connector *connector) return connector->connector_id; } -/* helper to unregister all connectors from sysfs for device */ +/* helpers to {un}register all connectors from sysfs for device */ +extern int drm_connector_register_all(struct drm_device *dev); extern void drm_connector_unregister_all(struct drm_device *dev); extern int drm_bridge_add(struct drm_bridge *bridge); -- cgit v1.2.3 From ba34d58c5e86c27accb3133fa991cfb6c848c58e Mon Sep 17 00:00:00 2001 From: Ezequiel Garcia Date: Tue, 19 Apr 2016 14:40:37 -0300 Subject: drm: probe_helper: Hide ugly ifdef Push the ifdef to the drm_edid.h and create a stub, for the DRM_LOAD_EDID_FIRMWARE=n case. This removes some clutter in the code, making it more readable. Signed-off-by: Ezequiel Garcia Reviewed-by: Jani Nikula Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1461087638-16959-1-git-send-email-ezequiel@vanguardiasur.com.ar --- include/drm/drm_edid.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include') diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index dec6221e8198..919933d1beb4 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h @@ -328,7 +328,15 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb); int drm_av_sync_delay(struct drm_connector *connector, const struct drm_display_mode *mode); struct drm_connector *drm_select_eld(struct drm_encoder *encoder); + +#ifdef CONFIG_DRM_LOAD_EDID_FIRMWARE int drm_load_edid_firmware(struct drm_connector *connector); +#else +static inline int drm_load_edid_firmware(struct drm_connector *connector) +{ + return 0; +} +#endif int drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame, -- cgit v1.2.3