Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8282883imu; Fri, 28 Dec 2018 14:30:22 -0800 (PST) X-Google-Smtp-Source: AFSGD/XE7YLSqFMDYThnKNOrEVuwlYiqVquKZAacm274kqF8TrqjHapWuZ81q9ioftu0x4+rSvs4 X-Received: by 2002:a62:d448:: with SMTP id u8mr29689964pfl.105.1546036222371; Fri, 28 Dec 2018 14:30:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546036222; cv=none; d=google.com; s=arc-20160816; b=zhVaJ7ibsw/FLXuCLAXZNjBuLflmdIPLNyokexHYCD2zylkB0Hsoq70avbb1LUSqdi U9vdqgAY5CfVEqjnLOLQOLW/dEAmD7HlALSuf5qM8a3pUn9iUmgirBG/sdQdHLA3ZDJi Vip+dVnaOfcOJOt6smhCAYgg9i2MQDOX0gKoUZMrQKJ4XGse976MQfVfLqJ72KY/Fi+a xeLdQx96kSPy9eN+AmDoZCFiL5xsZPZJFhCN36zBWzmfoiA0OQ0TUVZeRjGDNXhXJfgY +DyBuF5AuoaRg4xpjLxePEI8Dz3M2cAIvupqKKwgU1+PF382x+pQvg7oBeFjFt+YPFRj XCyA== 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=Ce0rj6CYDpN4dT4IO3V4JGJB7shOpKg7d+MOJatLcZA=; b=UOi8Ywo0dzpgOqMJDCtNtKByEefPsu62WmfIJaKzhmfWN+yMy33N+GqA2Ro/H6FvVa PAcG5s4OIGbrIvQXUkU739MIS/qivd1KJ7VWDkR7O2EBupxW0OZQkpTyIxJ8JQLeyYpe A16B4jLZcJ2HupVsukSe4yo5yDDFdYyUFp14cT4MrskLE1uKT1ghOzse7qWrqDBgRnBA mqPCcMXEAtGbrFrQLUsKJoYHWi0/m+VeP5ZG31gGjiFQvHr4klxhhtGHX5QwAkAY3Vne 7s4sH/+0nNYYm00ajGx6hf5f6XRZOEjosbbuQ8EF0asjfGqU4HY0lk4nXQqeYEmN2NHc qxWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@ffwll.ch header.s=google header.b=fhXOmjvx; 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 3si38695245plv.258.2018.12.28.14.30.04; Fri, 28 Dec 2018 14:30:22 -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=fhXOmjvx; 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 S1726808AbeL1MCJ (ORCPT + 99 others); Fri, 28 Dec 2018 07:02:09 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:34425 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725889AbeL1MCI (ORCPT ); Fri, 28 Dec 2018 07:02:08 -0500 Received: by mail-ed1-f66.google.com with SMTP id b3so17427386ede.1 for ; Fri, 28 Dec 2018 04:02:07 -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=Ce0rj6CYDpN4dT4IO3V4JGJB7shOpKg7d+MOJatLcZA=; b=fhXOmjvxFmS337N0fKx6Q96P7X9Ewg3A2ton6zSP0SAfBco3/4+48kWznE2pTXWP7N nzGSRSO2VAAEtgc3MRN1vqNPpeKN6IRJIyZP2wu0Mc6Fd9BdXGTmniDVZXtOpQwhUJ+W 1t8AHB+YMY0i7cJeFwmCjzRgfuGODOKg4EqVk= 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=Ce0rj6CYDpN4dT4IO3V4JGJB7shOpKg7d+MOJatLcZA=; b=E17f7V1c8Wl6ZWu9L8tHTZw7bb90SZ/KK8nhwfB1ED6Ehp9qzXHG5UHww+7+Ue4V+l h1X95LRr9OY5SNeoSXNr66AbI6zCzKvxmTCW0IgxiXHFbqatUBsrvwrlehK+clyozELO j4rs7EMA6iAP37tvl/G8Z9tZATp5nbjjbTXzxh9+PgFS3iPszIW8B4VCbxElYD2m34Ll +9s/Vci/sDayWwxjg+1iRspQDTva4EATBmpdibfunRxiifuLPuAhawskREFZwnw/9MPx HtI2XZ+envSnSb5LjAApHN6fUUpDx5hpa996zQn9XcQPyrnj/xQhYTCqFIxbW+dtB5Gt 0syw== X-Gm-Message-State: AA+aEWYZRn9cjnCDluohK/kQTT0Z+q937IZWAlOXM9y+NAs9qQqbO4DE btI/gRElsMXN85QuEylgaVHCRA== X-Received: by 2002:a50:b6d2:: with SMTP id f18mr21912520ede.263.1545998526708; Fri, 28 Dec 2018 04:02:06 -0800 (PST) Received: from dvetter-linux.ger.corp.intel.com ([194.230.159.220]) by smtp.gmail.com with ESMTPSA id a17-v6sm5103167ejr.55.2018.12.28.04.02.04 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 28 Dec 2018 04:02:05 -0800 (PST) Date: Fri, 28 Dec 2018 13:02:03 +0100 From: Daniel Vetter To: Ivan Mironov Cc: Daniel Vetter , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Sean Paul , David Airlie , saahriktu , Eugeniy Paltsev Subject: Re: [RFC PATCH 1/2] drm/fb-helper: Bring back workaround for bugs of SDL 1.2 Message-ID: <20181228120203.GQ9058@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: <20181226121124.1632-1-mironov.ivan@gmail.com> <20181226121124.1632-2-mironov.ivan@gmail.com> <20181227120046.GC9058@dvetter-linux.ger.corp.intel.com> <00547df7d87c7fe6d8c842d5b29a0cd6809cdf5d.camel@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <00547df7d87c7fe6d8c842d5b29a0cd6809cdf5d.camel@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:26:56AM +0500, Ivan Mironov wrote: > On Thu, 2018-12-27 at 13:00 +0100, Daniel Vetter wrote: > > > + /* > > > + * Workaround for SDL 1.2, which is known to be setting all pixel format > > > + * fields values to zero in some cases. We treat this situation as a > > > + * kind of "use some reasonable autodetected values". > > > + */ > > > + if (!var->red.offset && !var->green.offset && > > > + !var->blue.offset && !var->transp.offset && > > > + !var->red.length && !var->green.length && > > > + !var->blue.length && !var->transp.length && > > > + !var->red.msb_right && !var->green.msb_right && > > > + !var->blue.msb_right && !var->transp.msb_right) { > > > + u8 depth; > > > + > > > + /* > > > + * There is no way to guess the right value for depth when > > > + * bpp is 16 or 32. So we just restore the behaviour previously > > > + * introduced here by commit 785b93ef8c309. In fact, this was > > > + * implemented even earlier in various device drivers. > > > + */ > > > + switch (var->bits_per_pixel) { > > > + case 16: > > > + depth = 15; > > > + break; > > > + case 32: > > > + depth = 24; > > > + break; > > > + default: > > > + depth = var->bits_per_pixel; > > > + break; > > > + } > > > > The guesswork here looks fishy. We should still have the drm-side format, > > and should use that. > > This existed for a very long time until problematic commit was applied. > And there is a clear evidence that it was actually used by > applications. I'm not against guessing this stuff, but we know have much better format handling code than when this code was originally written. I just want to use that (like it's used everywhere else in this file now). fb->format gives you the right depth, no guessing needed at all. And if you guess wrong here, you'll fail in these format checks later on. -Daniel > > > Otherwise the patches look good I think, but they > > need a Fixes: tag and cc: stable so backporters know what to do with > > these. > > > > I added "cc: stable" into the regression fix. Also added more info into > the commit messages. See the PATCH v1 in the mailing list. > > Thanks. > > > -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch