From 2a8dc638f7af27ced60728e105752840fcd1538a Mon Sep 17 00:00:00 2001 From: Daniel Vetter Date: Wed, 7 May 2014 10:23:55 +0200 Subject: [PATCH 1/7] drm/dp-helper: Deprecate old i2c-over-dp_aux heleprs Only gma500 is still using this, once that's converted we can kill all this code. If that conversion doesn't happen soonish I think we should just move this helper code into the gma500 driver itself to avoid abuse from new drivers. Cc: Patrik Jakobsson Cc: Alan Cox Cc: Thierry Reding Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_dp_helper.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index a13f1f51f68e..494219ccdf96 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -213,6 +213,10 @@ i2c_dp_aux_prepare_bus(struct i2c_adapter *adapter) * * RETURNS: * 0 on success, -ERRNO on failure. + * + * IMPORTANT: + * This interface is deprecated, please switch to the new dp aux helpers and + * drm_dp_aux_register_i2c_bus(). */ int i2c_dp_aux_add_bus(struct i2c_adapter *adapter) From d3dbd9b21eb2b85c45522af676dc63c7de887caf Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 9 May 2014 08:14:14 +0200 Subject: [PATCH 2/7] drm/ast: Fix double lock at PM resume The recent commit [3ea87855: drm/helper: lock all around force mode restore] introduced drm_modeset_lock_all() in drm_helper_resume_force_mode() itself, while ast driver still takes this lock before calling it. Remove the caller side lock for avoid a fatal deadlock. Signed-off-by: Takashi Iwai Signed-off-by: Daniel Vetter --- drivers/gpu/drm/ast/ast_drv.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/ast/ast_drv.c b/drivers/gpu/drm/ast/ast_drv.c index 2ba39ac7d222..44074fbcf7ff 100644 --- a/drivers/gpu/drm/ast/ast_drv.c +++ b/drivers/gpu/drm/ast/ast_drv.c @@ -94,9 +94,7 @@ static int ast_drm_thaw(struct drm_device *dev) ast_post_gpu(dev); drm_mode_config_reset(dev); - drm_modeset_lock_all(dev); drm_helper_resume_force_mode(dev); - drm_modeset_unlock_all(dev); console_lock(); ast_fbdev_set_suspend(dev, 0); From e4f0fd8ca3250c7546148a89eec26ff3b8140103 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Fri, 9 May 2014 08:14:15 +0200 Subject: [PATCH 3/7] drm/exynos: Fix double locks at PM resume The recent commit [3ea87855: drm/helper: lock all around force mode restore] introduced drm_modeset_lock_all() in drm_helper_resume_force_mode() itself, while exynos driver takes this lock before calling it. Move the function call outside the lock for avoiding a deadlock. Signed-off-by: Takashi Iwai Signed-off-by: Daniel Vetter --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index 2d27ba23a6a8..79410b0c4bbf 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -183,9 +183,9 @@ static int exynos_drm_resume(struct drm_device *dev) if (connector->funcs->dpms) connector->funcs->dpms(connector, connector->dpms); } + drm_modeset_unlock_all(dev); drm_helper_resume_force_mode(dev); - drm_modeset_unlock_all(dev); return 0; } From f220e62659e968c3bbe4d96d73008832d19b9f77 Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 13 May 2014 12:47:42 +0200 Subject: [PATCH 4/7] drm/plane: Fix sparse warnings Include the drm_plane_helper.h header file to fix the following sparse warnings: CHECK drivers/gpu/drm/drm_plane_helper.c drivers/gpu/drm/drm_plane_helper.c:102:5: warning: symbol 'drm_primary_helper_update' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:219:5: warning: symbol 'drm_primary_helper_disable' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:233:6: warning: symbol 'drm_primary_helper_destroy' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:241:30: warning: symbol 'drm_primary_helper_funcs' was not declared. Should it be static? drivers/gpu/drm/drm_plane_helper.c:259:18: warning: symbol 'drm_primary_helper_create_plane' was not declared. Should it be static? Doing that makes gcc complain as follows: CC drivers/gpu/drm/drm_plane_helper.o drivers/gpu/drm/drm_plane_helper.c:260:19: error: conflicting types for 'drm_primary_helper_create_plane' struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ^ In file included from drivers/gpu/drm/drm_plane_helper.c:29:0: include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ^ drivers/gpu/drm/drm_plane_helper.c: In function 'drm_primary_helper_create_plane': drivers/gpu/drm/drm_plane_helper.c:274:11: warning: assignment discards 'const' qualifier from pointer target type formats = safe_modeset_formats; ^ In file included from include/linux/linkage.h:6:0, from include/linux/kernel.h:6, from include/drm/drmP.h:45, from drivers/gpu/drm/drm_plane_helper.c:27: drivers/gpu/drm/drm_plane_helper.c: At top level: drivers/gpu/drm/drm_plane_helper.c:289:15: error: conflicting types for 'drm_primary_helper_create_plane' EXPORT_SYMBOL(drm_primary_helper_create_plane); ^ include/linux/export.h:57:21: note: in definition of macro '__EXPORT_SYMBOL' extern typeof(sym) sym; \ ^ drivers/gpu/drm/drm_plane_helper.c:289:1: note: in expansion of macro 'EXPORT_SYMBOL' EXPORT_SYMBOL(drm_primary_helper_create_plane); ^ In file included from drivers/gpu/drm/drm_plane_helper.c:29:0: include/drm/drm_plane_helper.h:42:19: note: previous declaration of 'drm_primary_helper_create_plane' was here struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, ^ Which can easily be fixed by making the signatures of the implementation and the prototype match. Signed-off-by: Thierry Reding Reviewed-by: Matt Roper Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_plane_helper.c | 1 + include/drm/drm_plane_helper.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index d966afa7ecae..f16bb92db577 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -26,6 +26,7 @@ #include #include #include +#include #define SUBPIXEL_MASK 0xffff diff --git a/include/drm/drm_plane_helper.h b/include/drm/drm_plane_helper.h index 09824becee3e..c5e7ab9503c8 100644 --- a/include/drm/drm_plane_helper.h +++ b/include/drm/drm_plane_helper.h @@ -42,7 +42,7 @@ extern int drm_primary_helper_disable(struct drm_plane *plane); extern void drm_primary_helper_destroy(struct drm_plane *plane); extern const struct drm_plane_funcs drm_primary_helper_funcs; extern struct drm_plane *drm_primary_helper_create_plane(struct drm_device *dev, - uint32_t *formats, + const uint32_t *formats, int num_formats); From 233fd4ec92b90a2d3bb5104d17835072ba2fde4b Mon Sep 17 00:00:00 2001 From: Thierry Reding Date: Tue, 13 May 2014 16:58:35 +0200 Subject: [PATCH 5/7] drm/plane: Fix a couple of checkpatch warnings Code should be indented using tabs rather than spaces (see CodingStyle) and the canonical form to declare a constant static variable is using "static const" rather than "const static". Fixes the following warnings from checkpatch: $ scripts/checkpatch.pl -f drivers/gpu/drm/drm_plane_helper.c WARNING: storage class should be at the beginning of the declaration #40: FILE: drivers/gpu/drm/drm_plane_helper.c:40: +const static uint32_t safe_modeset_formats[] = { WARNING: please, no spaces at the start of a line #41: FILE: drivers/gpu/drm/drm_plane_helper.c:41: + DRM_FORMAT_XRGB8888,$ WARNING: please, no spaces at the start of a line #42: FILE: drivers/gpu/drm/drm_plane_helper.c:42: + DRM_FORMAT_ARGB8888,$ Signed-off-by: Thierry Reding Reviewed-by: Matt Roper Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_plane_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/drm_plane_helper.c b/drivers/gpu/drm/drm_plane_helper.c index f16bb92db577..d93c895d559e 100644 --- a/drivers/gpu/drm/drm_plane_helper.c +++ b/drivers/gpu/drm/drm_plane_helper.c @@ -37,9 +37,9 @@ * creating the primary plane. However drivers that still call * drm_plane_init() will use this minimal format list as the default. */ -const static uint32_t safe_modeset_formats[] = { - DRM_FORMAT_XRGB8888, - DRM_FORMAT_ARGB8888, +static const uint32_t safe_modeset_formats[] = { + DRM_FORMAT_XRGB8888, + DRM_FORMAT_ARGB8888, }; /* From 7927096868061ff10fdb33b295dc0bcfebe2b35b Mon Sep 17 00:00:00 2001 From: Ross Zwisler Date: Wed, 14 May 2014 09:41:12 -0600 Subject: [PATCH 6/7] drm: Missed clflushopt in drm_clflush_virt_range With this commit: 2a0788dc9bc4 x86: Use clflushopt in drm_clflush_virt_range If clflushopt is available on the system, we use it instead of clflush in drm_clflush_virt_range. There were two calls to clflush in this function, but only one was changed to clflushopt. This patch changes the other clflush call to clflushopt. Signed-off-by: Ross Zwisler Reported-by: Matthew Wilcox Cc: David Airlie Cc: dri-devel@lists.freedesktop.org Cc: H Peter Anvin Cc: Ingo Molnar Cc: Thomas Gleixner Signed-off-by: Daniel Vetter --- drivers/gpu/drm/drm_cache.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_cache.c b/drivers/gpu/drm/drm_cache.c index ae251b8abd0e..a6b690626a6b 100644 --- a/drivers/gpu/drm/drm_cache.c +++ b/drivers/gpu/drm/drm_cache.c @@ -138,7 +138,7 @@ drm_clflush_virt_range(void *addr, unsigned long length) void *end = addr + length; mb(); for (; addr < end; addr += boot_cpu_data.x86_clflush_size) - clflush(addr); + clflushopt(addr); clflushopt(end - 1); mb(); return; From 46340642d7c314e4d718ebcdbb00bd55ed7d9d9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincent=20Stehl=C3=A9?= Date: Sun, 25 May 2014 23:54:14 +0200 Subject: [PATCH 7/7] imx-drm: imx-tve: remove unused variable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit f9b0e251dfbf 'drm: make mode_valid callback optional' left variable ret unused; remove it. This fixes the following compilation warning: drivers/staging/imx-drm/imx-tve.c: In function ‘imx_tve_connector_mode_valid’: drivers/staging/imx-drm/imx-tve.c:252:6: warning: unused variable ‘ret’ [-Wunused-variable] Signed-off-by: Vincent Stehlé Cc: Andrzej Hajda Cc: Daniel Vetter Cc: Greg Kroah-Hartman Signed-off-by: Daniel Vetter --- drivers/staging/imx-drm/imx-tve.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/staging/imx-drm/imx-tve.c b/drivers/staging/imx-drm/imx-tve.c index 5a5a5287a86a..af8af4d1c988 100644 --- a/drivers/staging/imx-drm/imx-tve.c +++ b/drivers/staging/imx-drm/imx-tve.c @@ -249,7 +249,6 @@ static int imx_tve_connector_mode_valid(struct drm_connector *connector, { struct imx_tve *tve = con_to_tve(connector); unsigned long rate; - int ret; /* pixel clock with 2x oversampling */ rate = clk_round_rate(tve->clk, 2000UL * mode->clock) / 2000;