From 949f08862d662f17b9d2929c6afb2d4e8f5d50cb Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Tue, 29 Nov 2016 22:56:30 +0200 Subject: drm: Make the connector .detect() callback optional Many drivers (21 to be exact) create connectors that are always connected (for instance to an LVDS or DSI panel). Instead of forcing them to implement a dummy .detect() handler, make the callback optional and consider the connector as always connected in that case. Reviewed-by: Alex Deucher Acked-by: Maxime Ripard Acked-by: Jyri Sarha Acked-by: Jani Nikula Acked-by: Philipp Zabel Acked-by: Vincent Abriou Acked-by: Alexey Brodkin Signed-off-by: Laurent Pinchart [seanpaul fixed small conflict in rcar-du/rcar_du_lvdscon.c] Signed-off-by: Sean Paul --- drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 7 ------- 1 file changed, 7 deletions(-) (limited to 'drivers/gpu/drm/amd/amdgpu') diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c index 81cbf0b05dff..1d93e123532d 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c @@ -429,12 +429,6 @@ dce_virtual_dpms(struct drm_connector *connector, int mode) return 0; } -static enum drm_connector_status -dce_virtual_detect(struct drm_connector *connector, bool force) -{ - return connector_status_connected; -} - static int dce_virtual_set_property(struct drm_connector *connector, struct drm_property *property, @@ -463,7 +457,6 @@ static const struct drm_connector_helper_funcs dce_virtual_connector_helper_func static const struct drm_connector_funcs dce_virtual_connector_funcs = { .dpms = dce_virtual_dpms, - .detect = dce_virtual_detect, .fill_modes = drm_helper_probe_single_connector_modes, .set_property = dce_virtual_set_property, .destroy = dce_virtual_destroy, -- cgit v1.2.3 From 58309befa82d81f6e9dc36a92d2a339ef2144535 Mon Sep 17 00:00:00 2001 From: Nicolai Stange Date: Mon, 5 Dec 2016 21:30:22 +0100 Subject: drm/amdgpu: don't add files at control minor debugfs directory Since commit 8a357d10043c ("drm: Nerf DRM_CONTROL nodes"), a struct drm_device's ->control member is always NULL. In the case of CONFIG_DEBUG_FS=y, amdgpu_debugfs_add_files() accesses ->control->debugfs_root though. This results in a NULL pointer dereference. Fix this by omitting the drm_debugfs_create_files() call for the control minor debugfs directory which is now non-existent anyway. Fixes: 8a357d10043c ("drm: Nerf DRM_CONTROL nodes") Signed-off-by: Nicolai Stange Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98915 Reviewed-by: Alex Deucher Tested-by: Mike Lothian Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/20161205203022.11671-1-nicstange@gmail.com --- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ------ 1 file changed, 6 deletions(-) (limited to 'drivers/gpu/drm/amd/amdgpu') diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 9e16e975f31a..76cc47a9a7fb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c @@ -2505,9 +2505,6 @@ int amdgpu_debugfs_add_files(struct amdgpu_device *adev, adev->debugfs[adev->debugfs_count].num_files = nfiles; adev->debugfs_count = i; #if defined(CONFIG_DEBUG_FS) - drm_debugfs_create_files(files, nfiles, - adev->ddev->control->debugfs_root, - adev->ddev->control); drm_debugfs_create_files(files, nfiles, adev->ddev->primary->debugfs_root, adev->ddev->primary); @@ -2521,9 +2518,6 @@ static void amdgpu_debugfs_remove_files(struct amdgpu_device *adev) unsigned i; for (i = 0; i < adev->debugfs_count; i++) { - drm_debugfs_remove_files(adev->debugfs[i].files, - adev->debugfs[i].num_files, - adev->ddev->control); drm_debugfs_remove_files(adev->debugfs[i].files, adev->debugfs[i].num_files, adev->ddev->primary); -- cgit v1.2.3