Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8245112imu; Fri, 28 Dec 2018 13:35:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN5HAMt3Smqi9D/el0bB9sNRQe/JinRUCC1HCs1T0H0nlG4BF9yVFK6OIqt4E3pOUv7Miitp X-Received: by 2002:a62:435a:: with SMTP id q87mr29059577pfa.109.1546032910072; Fri, 28 Dec 2018 13:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546032910; cv=none; d=google.com; s=arc-20160816; b=kDWsyzBgcLrn+n3b1CbTIvF3bYjum6Gtk7HbbmxLxv0QlJZAZMvqfkaxlAM7h7RJQt jT5q1jjU3jZEojP1b/O/KbqTW2JgYLUMEpMMg2XKAhUSr6gp0Zl9Q2G+dGbm03cPghHo XCAQgQz0bp7UNPwFxvy2xyxsaQylb2QKFan+hPmBl2nTI38avg6BI07HfIZncgLtbYC2 5Pr1W3/KXnAwanyMoeWvRxav2JQVlScz4+UDbigPmZL3ckZCEOmGCMLCpN1lLpAzD7MC jrHVVk37qNoKtHtsIhr1fwz2/2buzlUcnS0wYH3LZdupxiv9VqkQ5vU829By5mQmxcYs 0RCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:mail-followup-to :message-id:subject:cc:to:from:date:dkim-signature; bh=hQzZl3teCsnULOMDzfToWa1ZpsYJloOsq0xqC1iX5mI=; b=Bei1TcK8b7H2v8rAZyAwxB3XPj8LmqFXMql6wm5DHHa6Uf2zXnskgU01LfhLJ1eHmB IZwWJp2ktesxRBDppsjTfy3Lk583dK+pyQEpDKd+q/tW6m7IdbGOfIVfPmtl7QrGaBAy UnAsDlJncyLxegUql3fx2qqg/b+ReoF2qPApsaES8g9yfzxXprr8BtRHKoGaBUTW1WvT hUYd/m9+BJhs4+m6R4u7fQRzz9ACL0544ft8Z5vmXvtSfVF8miAkbBOHOTt4zSss2qts q/Nj/ejlPKGZL+Au3HjVCpMSJ/SUdMEedfGok/g1TnqN9UXfxiVeX8enNIxJUvpekikz jI7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=ZAOtaTxE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bj11si37094328plb.21.2018.12.28.13.34.54; Fri, 28 Dec 2018 13:35:10 -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=fail header.i=@ffwll.ch header.s=google header.b=ZAOtaTxE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbeL1MG7 (ORCPT + 99 others); Fri, 28 Dec 2018 07:06:59 -0500 Received: from mail-ed1-f68.google.com ([209.85.208.68]:37591 "EHLO mail-ed1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbeL1MG7 (ORCPT ); Fri, 28 Dec 2018 07:06:59 -0500 Received: by mail-ed1-f68.google.com with SMTP id h15so17389982edb.4 for ; Fri, 28 Dec 2018 04:06:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=sender:date:from:to:cc:subject:message-id:mail-followup-to :references:mime-version:content-disposition:in-reply-to:user-agent; bh=hQzZl3teCsnULOMDzfToWa1ZpsYJloOsq0xqC1iX5mI=; b=ZAOtaTxEIUxC7Lhs/BOODrGJw5bcyVBDRe/AgD/HBcsHlPNI3D37GwXeLBXWooz4oH JAdqhsM2hnHDQZmeFse/Hq8+Mn6yN2GdircRR5g2ZJsVoF/JRh90JYWCj33L9qFg0/cz BJQMNy+BJvPakZwH7/MNncPlK5061WGsHQllM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to:user-agent; bh=hQzZl3teCsnULOMDzfToWa1ZpsYJloOsq0xqC1iX5mI=; b=YQlETpM15fYXrV0ahuj8LNljR+AL0bUVGFfPwQdSwXrN8ZLnYrCriwee0QxUKd6mX8 0MCDGMR9LNS+z6uwwSwYee5Vt1aUcpTXxEr99BCk9RihbMyMr36kqR6KqlmtJHtcqFgb Pe6ywwMg6glOkoLCD0cdqGRwKclreTsSmdWVUFpBOItSimiZTc7MFoRk2Y+6S+ZwbJvq JDXtk7fBLEdjFBsIQZ/C9BAJAxYAZneItm1IaFb0/SgjvTMIDevV4VNj+63HAQw3cfBC /gUjiTVjm/Dklrgq/BVQMi8ZdT4wzEmGqukhtNKdBpv/CB2xJv14GsZmPYcDxtvMKxVK KjrA== X-Gm-Message-State: AJcUukeGlJ7Q7mddf7skK4jEoIQC0SWlc8V70cgIG8l7YjYyBS9muP+s E4FmGGZuDB81yTD3U4CQO4ooZQ== X-Received: by 2002:a17:906:d0c6:: with SMTP id bq6-v6mr13598531ejb.99.1545998816589; Fri, 28 Dec 2018 04:06:56 -0800 (PST) Received: from dvetter-linux.ger.corp.intel.com ([194.230.159.220]) by smtp.gmail.com with ESMTPSA id j31sm12995044eda.46.2018.12.28.04.06.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Dec 2018 04:06:55 -0800 (PST) Date: Fri, 28 Dec 2018 13:06:53 +0100 From: Daniel Vetter To: Ivan Mironov Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , Daniel Vetter , saahriktu , Eugeniy Paltsev Subject: Re: [PATCH v1 2/2] drm/fb-helper: Ignore the value of fb_var_screeninfo.pixclock Message-ID: <20181228120652.GR9058@dvetter-linux.ger.corp.intel.com> Mail-Followup-To: Ivan Mironov , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , saahriktu , Eugeniy Paltsev References: <20181227231308.16904-1-mironov.ivan@gmail.com> <20181227231308.16904-3-mironov.ivan@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181227231308.16904-3-mironov.ivan@gmail.com> X-Operating-System: Linux dvetter-linux.ger.corp.intel.com 4.19.10-200.fc28.x86_64 User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 28, 2018 at 04:13:08AM +0500, Ivan Mironov wrote: > 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. > > However, while enabling SDL1 applications to work out of the box when > there is no /etc/fb.modes with valid settings, this change affects the > video mode choosing logic in SDL. Depending on current screen > resolution, contents of /etc/fb.modes and resolution requested by > application, this may lead to user-visible difference (not always): > image will be displayed in a right way, but it will be aligned to the > left instead of center. There is no "right behaviour" here as well, as > emulated fbdev, opposing to old fbdev drivers, simply ignores any > requsts of video mode changes with resolutions smaller than current. > > Feel free to NAK this patch if you think that it causes breakage of > user-space =). It's a regression, we don't nack regression fixes :-) > The easiest way to reproduce this problem is to install sdl-sopwith[2], > remove /etc/fb.modes file if it exists, and then try to run sopwith > from console without X. At least in Fedora 29, sopwith may be simply > installed from standard repositories. > > [1] SDL 1.2.15 source code, src/video/fbcon/SDL_fbvideo.c, vesa_timings > [2] http://sdl-sopwith.sourceforge.net/ > > Signed-off-by: Ivan Mironov I thought this is also a regression fix, so also needs Fixes: and cc: stable? -Daniel > --- > 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 > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch