Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5502631imu; Wed, 26 Dec 2018 04:15:19 -0800 (PST) X-Google-Smtp-Source: ALg8bN5+dc+LV3OKJtS1vMwA9Om8JA+g1rIQ/Vxwek6HyzfSLYORTgHYi4881Y/+TaHTvoMglBSo X-Received: by 2002:a63:b94c:: with SMTP id v12mr18623642pgo.221.1545826519261; Wed, 26 Dec 2018 04:15:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545826519; cv=none; d=google.com; s=arc-20160816; b=TvLjfWcBko68NDHzbjs2FqHLJW0KdF6NFpiSNUs5mR4kmhbHVs8RTjH3OJz4ZX/tZy /Fe+X+ml1uJKPLXXwqbUbBOcapTc1dt1nNJHA6mkMSx+21nmkA999YZsi6IWv+NcozaU sceNcNzSFQIJBZVG4NM0XbjOtl2n1WtNMoS4g/Hhhf6TuaVjylQlrzaxNF8NWf6lO02G PC6LFEzfr3+C+c2eM1reOGHSD2Y3kxHujCYp/OzqDvaW/ZiS1raUSvUfb1R9ZnDliKQ1 Dez7Lcvo/Vp4TYEHd6cha4QX3KwvoxBqGQnw49G1v/MojkldJ83GGjpV/zI/pWVXyPiF 5+zA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=+X0w/THYbT3kbTpjSVwr2WN+4tEBcCin8XCOgT3iv2w=; b=BaghluUlTtqA1WD4KbA3U79bOIrw+WERw/1Bta3oW51uNJoPh2GJXnjv9NEb6Sb00B lgHBOzNDPpLj6Yb7X4HeZN7TXL3pNifVimhSpoNlNfcsX5hru3h6YPeGO8siBfbZo8ks +v8dLgNV19h9wOVjWpbUL1iFFcygyRwN3Mf7L6SkvG854Ep1nnpckYU61YLCu4X5kMWW 2GIjkdCs8oHIgLxF4kcuarRm+By1AiqYOHWTxlZiwL6N+y9gkrC21YLPsDbBWmYykpCk +STTsA05lKBpqh+pz/e4RHqKjG6reS8hUQk9k698N/igGXM47LJXWD0sNcCtFSXxiTM7 xe1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rPVp8VBt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si32944344pgs.447.2018.12.26.04.15.03; Wed, 26 Dec 2018 04:15:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rPVp8VBt; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726798AbeLZMLs (ORCPT + 99 others); Wed, 26 Dec 2018 07:11:48 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:44940 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726177AbeLZMLs (ORCPT ); Wed, 26 Dec 2018 07:11:48 -0500 Received: by mail-lj1-f193.google.com with SMTP id k19-v6so13705634lji.11 for ; Wed, 26 Dec 2018 04:11:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+X0w/THYbT3kbTpjSVwr2WN+4tEBcCin8XCOgT3iv2w=; b=rPVp8VBtmMIMBtT8jATY75owFpc5NiNuVhYUlldMQZd2IvDYUarP21JlfJUXKfR3D+ RhAqQuIz89MGwrz187kqf8E9HrL6pJWqd1RTxkEMMMtjoCy/BpaZytpd4xKNoqgcjKdD KiN8dLeKvRogtpyC8cyUkAhkdKcXCEexgdiNKF4ps4xKagx3xw6mVGG5Fm/aqom+BdLK 6BUAfoLAQzAR1TldgZ4QbDoduhiqCzFX1R5xkMWBTlOGWrHETFfp2EaskyZIYhvdLCf8 Ft2cUAiJszzH3MgOg8V2k9Hq/srYa8VqT3cspIF5AypLpCLN8SxtlAaZqXkTc+n0bQ/v 76vw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+X0w/THYbT3kbTpjSVwr2WN+4tEBcCin8XCOgT3iv2w=; b=ssNBOQm6K+1uSqiwXBIMT7VwatcpsqGq22Wpi0QiIaHnWyJch96jrvL2YHayOTlNHx VSDABIq5GHQcs4A1jip+qmWfbAgnMv0Yyswmt3n3pMpzHxFGJyzyct2X+d7KzUGrwvAl mU82eqgTuHYwnWN4cinHKMfcgETi3RHVn9+P0VqXClWc7yMxwwHetFZY6M/B3juPpGtZ cyjG346HK8evk9N2sa8lGoEYCyOm7FV3UgZdaxgPskpU5ykQYQuABZj93S3EceTysOrJ TXjJ+GjUy85uiNAdfPQ3Kn2SsCYQRzu7Qme8LFGbHgJohvbj4koqBLtzAWncw/Zck+nz Ud6Q== X-Gm-Message-State: AJcUukeJexaWtfxHNZwz4PA76GFaUb5GtmhFARlK/EMbO9qbwATqHUK/ dZH2QhZqGGMeSHfS4R1JnZvWfpRZfIGb5Q== X-Received: by 2002:a2e:9556:: with SMTP id t22-v6mr12374903ljh.36.1545826305892; Wed, 26 Dec 2018 04:11:45 -0800 (PST) Received: from localhost.localdomain (pool-109-191-228-208.is74.ru. [109.191.228.208]) by smtp.gmail.com with ESMTPSA id q6sm7037684lfh.52.2018.12.26.04.11.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Dec 2018 04:11:45 -0800 (PST) From: Ivan Mironov To: dri-devel@lists.freedesktop.org Cc: linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , saahriktu , Eugeniy Paltsev , Ivan Mironov Subject: [RFC PATCH 2/2] drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock Date: Wed, 26 Dec 2018 17:11:24 +0500 Message-Id: <20181226121124.1632-3-mironov.ivan@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20181226121124.1632-1-mironov.ivan@gmail.com> References: <20181226121124.1632-1-mironov.ivan@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Strict requirement of pixclock to be zero breaks support of SDL 1.2 which contains hardcoded table of supported video modes with non-zero pixclock values[1]. To better understand which pixclock values are considered valid and how driver should handle these values, I briefly examined few existing fbdev drivers and documentation in Documentation/fb/. And it looks like there are no strict rules on that and actual behaviour varies: * some drivers treat (pixclock == 0) as "use defaults" (uvesafb.c); * some treat (pixclock == 0) as invalid value which leads to -EINVAL (clps711x-fb.c); * some pass converted pixclock value to hardware (uvesafb.c); * some are trying to find nearest value from predefined table (vga16fb.c, video_gx.c). Given this, I believe that it should be safe to just ignore this value if changing is not supported. It seems that any portable fbdev application which was not written only for one specific device working under one specific kernel version should not rely on any particular behaviour of pixclock anyway. [1] SDL 1.2.15 source code, src/video/fbcon/SDL_fbvideo.c, vesa_timings Signed-off-by: Ivan Mironov --- drivers/gpu/drm/drm_fb_helper.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fb_helper.c b/drivers/gpu/drm/drm_fb_helper.c index aff576c3c4fb..b95a0c23c7c8 100644 --- a/drivers/gpu/drm/drm_fb_helper.c +++ b/drivers/gpu/drm/drm_fb_helper.c @@ -1690,9 +1690,14 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var, struct drm_fb_helper *fb_helper = info->par; struct drm_framebuffer *fb = fb_helper->fb; - if (var->pixclock != 0 || in_dbg_master()) + if (in_dbg_master()) return -EINVAL; + if (var->pixclock != 0) { + DRM_DEBUG("fbdev emulation doesn't support changing the pixel clock, value of pixclock is ignored\n"); + var->pixclock = 0; + } + if ((drm_format_info_block_width(fb->format, 0) > 1) || (drm_format_info_block_height(fb->format, 0) > 1)) return -EINVAL; -- 2.20.1