From patchwork Fri Apr 13 09:40:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Huth X-Patchwork-Id: 10339719 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4AA5760541 for ; Fri, 13 Apr 2018 09:41:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4D1522872E for ; Fri, 13 Apr 2018 09:41:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41DD928744; Fri, 13 Apr 2018 09:41:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D8F302872E for ; Fri, 13 Apr 2018 09:41:08 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 786606E3F8; Fri, 13 Apr 2018 09:41:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4B7A46E3F8 for ; Fri, 13 Apr 2018 09:41:03 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 7DD37406E8A4; Fri, 13 Apr 2018 09:41:02 +0000 (UTC) Received: from thh440s.redhat.com (ovpn-116-23.ams2.redhat.com [10.36.116.23]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0FA232026DFD; Fri, 13 Apr 2018 09:41:00 +0000 (UTC) From: Thomas Huth To: Gustavo Padovan , Maarten Lankhorst , Sean Paul , David Airlie , dri-devel@lists.freedesktop.org Subject: [PATCH 2/2] drm: Make the DRM code compilable without CONFIG_I2C Date: Fri, 13 Apr 2018 11:40:56 +0200 Message-Id: <1523612456-14827-3-git-send-email-thuth@redhat.com> In-Reply-To: <1523612456-14827-1-git-send-email-thuth@redhat.com> References: <1523612456-14827-1-git-send-email-thuth@redhat.com> X-Scanned-By: MIMEDefang 2.78 on 10.11.54.4 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 13 Apr 2018 09:41:02 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.7]); Fri, 13 Apr 2018 09:41:02 +0000 (UTC) for IP:'10.11.54.4' DOMAIN:'int-mx04.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'thuth@redhat.com' RCPT:'' X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: borntraeger@de.ibm.com, Farhan Ali , linux-kernel@vger.kernel.org, Gerd Hoffmann MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Selecting CONFIG_HDMI for S390 is inappropriate - there is no real graphic hardware on this architecture. The drm subsystem is only enabled here for using the virtual graphics card "virtio-gpu". So it should be possible to compile the drm subsystem also without CONFIG_I2C. Tweak the Makefile to only compile the affected files with CONFIG_I2C=y and disable some I2C-related code in drm_edid.c. Signed-off-by: Thomas Huth --- drivers/gpu/drm/Kconfig | 4 ++-- drivers/gpu/drm/Makefile | 16 +++++++++------- drivers/gpu/drm/drm_edid.c | 10 +++++++--- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 298a518..c9df67f 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig @@ -10,8 +10,8 @@ menuconfig DRM select DRM_PANEL_ORIENTATION_QUIRKS select HDMI if !S390 select FB_CMDLINE - select I2C - select I2C_ALGOBIT + select I2C if !S390 + select I2C_ALGOBIT if !S390 select DMA_SHARED_BUFFER select SYNC_FILE help diff --git a/drivers/gpu/drm/Makefile b/drivers/gpu/drm/Makefile index 16fd8e3..4cf53ba 100644 --- a/drivers/gpu/drm/Makefile +++ b/drivers/gpu/drm/Makefile @@ -7,10 +7,9 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_context.o drm_dma.o \ drm_file.o drm_gem.o drm_ioctl.o drm_irq.o \ drm_lock.o drm_memory.o drm_drv.o \ - drm_scatter.o drm_pci.o \ + drm_scatter.o drm_pci.o drm_info.o \ drm_sysfs.o drm_hashtab.o drm_mm.o \ drm_crtc.o drm_fourcc.o drm_modes.o drm_edid.o \ - drm_info.o drm_encoder_slave.o \ drm_trace_points.o drm_global.o drm_prime.o \ drm_rect.o drm_vma_manager.o drm_flip_work.o \ drm_modeset_lock.o drm_atomic.o drm_bridge.o \ @@ -20,6 +19,7 @@ drm-y := drm_auth.o drm_bufs.o drm_cache.o \ drm_dumb_buffers.o drm_mode_config.o drm_vblank.o \ drm_syncobj.o drm_lease.o +drm-$(CONFIG_I2C) += drm_encoder_slave.o drm-$(CONFIG_HDMI) += drm_hdmi.o drm-$(CONFIG_DRM_LIB_RANDOM) += lib/drm_random.o drm-$(CONFIG_DRM_VM) += drm_vm.o @@ -32,11 +32,13 @@ drm-$(CONFIG_AGP) += drm_agpsupport.o drm-$(CONFIG_DEBUG_FS) += drm_debugfs.o drm_debugfs_crc.o drm-$(CONFIG_DRM_LOAD_EDID_FIRMWARE) += drm_edid_load.o -drm_kms_helper-y := drm_crtc_helper.o drm_dp_helper.o drm_probe_helper.o \ - drm_plane_helper.o drm_dp_mst_topology.o drm_atomic_helper.o \ - drm_kms_helper_common.o drm_dp_dual_mode_helper.o \ - drm_simple_kms_helper.o drm_modeset_helper.o \ - drm_scdc_helper.o drm_gem_framebuffer_helper.o +drm_kms_helper-y := drm_crtc_helper.o drm_probe_helper.o \ + drm_plane_helper.o drm_atomic_helper.o \ + drm_gem_framebuffer_helper.o drm_kms_helper_common.o \ + drm_simple_kms_helper.o drm_modeset_helper.o + +drm_kms_helper-$(CONFIG_I2C) += drm_dp_helper.o drm_dp_mst_topology.o \ + drm_dp_dual_mode_helper.o drm_scdc_helper.o drm_kms_helper-$(CONFIG_DRM_PANEL_BRIDGE) += bridge/panel.o drm_kms_helper-$(CONFIG_DRM_FBDEV_EMULATION) += drm_fb_helper.o diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 3820763..0d0d5af 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -1467,11 +1467,14 @@ bool drm_edid_is_valid(struct edid *edid) static int drm_do_probe_ddc_edid(void *data, u8 *buf, unsigned int block, size_t len) { - struct i2c_adapter *adapter = data; - unsigned char start = block * EDID_LENGTH; unsigned char segment = block >> 1; unsigned char xfers = segment ? 3 : 2; - int ret, retries = 5; + int ret = -1; + +#if IS_ENABLED(CONFIG_I2C) + struct i2c_adapter *adapter = data; + unsigned char start = block * EDID_LENGTH; + int retries = 5; /* * The core I2C driver will automatically retry the transfer if the @@ -1512,6 +1515,7 @@ bool drm_edid_is_valid(struct edid *edid) break; } } while (ret != xfers && --retries); +#endif /* CONFIG_I2C */ return ret == xfers ? 0 : -1; }