Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp5381919rwp; Mon, 17 Jul 2023 03:11:20 -0700 (PDT) X-Google-Smtp-Source: APBJJlFxFNKfyFMbPKt2mI6Cz5z2wIvMhaPMAsdBKCbUVmVQxsPEuHtNTWeDBCYxHbnxazccxgIr X-Received: by 2002:a17:902:c40f:b0:1b1:753a:49ce with SMTP id k15-20020a170902c40f00b001b1753a49cemr11650647plk.53.1689588680629; Mon, 17 Jul 2023 03:11:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689588680; cv=none; d=google.com; s=arc-20160816; b=HP+IjoCsJvzB/fJ7zMOIvP4zueku9/uCHwEWVJ0e91WyjOK5tK60IGCmNwNMpTECxb o9U2oYMt9vsi1TdPWu8DdH05MeBml53MuPe8P4vN4f7Et7DeY0x9lnGLOEoFudY7KUlu OhnAYzzpIVu0puFOwwQEhxngjn+lV2za3p5s+/ihyEtCQQEQVgD2p3yH+zb8r3e2dvd+ alxFmCRLqRFM2GfZXJVSVXPQ+2CY50hXkEusmfn8qY7rMU+YscDRlkYGGbviRXPmWZQK 3MdrIAGNBPdZ8drm08gIsWb+iw9j0GpNyB9M/TRn6bW9eF9N+7RHFImBHGMHrLsR55RK QhaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=ceQGhU3Q6lPXE1UkwKN4clGf/gwccYZAeCnjr8dMuvU=; fh=pu5owzzw8NOVuv6ccZ9TiAvzqt6qbSBoeAE+F2AmgTY=; b=rN4QM732C+90p7DKxqaJBZ2NZncwENZvMiiVH5fCkjL8DFOGEFqL4I4OOwQOhyScqD fPUGk86Qhuf6trxMuARpFkRpnWDVK/SVHCHpRza42Ac+vBUS60X8/+nXStcY2vMLw+FV tdBEHah+Ap0pqufg4qbXW/Pg8K1HypqUoOIDhaVAZ74uG33K2RWKW3jPE302oSIbb8ak mfulna4BXmbxkxJwVzHsANNFUGCikLZwW1DoUEi3AHRI8CngeUs1x5bt4D4wDkzMSPMM Sa3MxJuGWzuzDzgmJANZfhyZTGhgJZAlVn/JCDEzWj4kYw9oXkTpBisfgxRxJXvFVqQV MEJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gP/5HLz5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i5-20020a170902c94500b001b8419bd0f5si12041249pla.254.2023.07.17.03.11.08; Mon, 17 Jul 2023 03:11:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="gP/5HLz5"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231268AbjGQJnq (ORCPT + 99 others); Mon, 17 Jul 2023 05:43:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45600 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230256AbjGQJnT (ORCPT ); Mon, 17 Jul 2023 05:43:19 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E138A4 for ; Mon, 17 Jul 2023 02:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1689586943; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ceQGhU3Q6lPXE1UkwKN4clGf/gwccYZAeCnjr8dMuvU=; b=gP/5HLz5kSJtiaAVzYzBWwD6usPtC5FC7PqSYIr8AQKyYNnfbtVQ9QZbsnD0YgW46sgsCK apm/YlNGdgRPMr32WF0GYl9OAPqGpzp9yVyMwZ9eszJIG1x9KbIBXLk3QeqzEPNb3wGfWL MYJP4wjHxqMYiQEyWsxKJT9fE2ApMrk= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-361-oKbGejfEMXeXGBRIL83CxA-1; Mon, 17 Jul 2023 05:42:21 -0400 X-MC-Unique: oKbGejfEMXeXGBRIL83CxA-1 Received: by mail-wm1-f71.google.com with SMTP id 5b1f17b1804b1-3fbe590234aso24597985e9.1 for ; Mon, 17 Jul 2023 02:42:21 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689586940; x=1692178940; h=content-transfer-encoding:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ceQGhU3Q6lPXE1UkwKN4clGf/gwccYZAeCnjr8dMuvU=; b=aGyEEkt/AHOOusxhKYTbKNcUdXjb8XqsiHaM9lrqm6E+Ae9I2qYouRCzMuGU27IP1s 8SXfZHYl1xI1mT5ouNl32OHmvKUgIi2V01YlEZVWg6oRJnCZt4Hqg7HCYrIzJgVoEodR 5mkheyvzXxSc6tNCQ1kJ5TLh+LLpAowUgqiOSS9nzi4V9K+U4xLJM5g5jM6iu7XZDc9n qrAIJL4RogVgN5RtPe9crAcTNnr+4wgrk17YdrcEb1X0bps0e6+KxCDa/3gnaahbRWy6 ogn0FH5o6DhgjJlmGv5mH4BggInEq1kPE3wXLoQu8mi4bfBK/DDMQhOg0ZrOtRzAIZ9d KX5Q== X-Gm-Message-State: ABy/qLby+rrUBApdx4D4X46YHs9vLUibqHPYJ0ztoINTVd1KPgxgR2xx d9oPjcmUYbCRzFi/iPq7YE4kTjBpFj6veZv2lT624isTW4LV5U1r1WTN0kW9/3gJRxMvKgQhA6j lUKAJB0y0IDUXAP3mD9CszUJG X-Received: by 2002:a05:600c:28c:b0:3fb:ff8f:2db0 with SMTP id 12-20020a05600c028c00b003fbff8f2db0mr10562564wmk.39.1689586940620; Mon, 17 Jul 2023 02:42:20 -0700 (PDT) X-Received: by 2002:a05:600c:28c:b0:3fb:ff8f:2db0 with SMTP id 12-20020a05600c028c00b003fbff8f2db0mr10562552wmk.39.1689586940260; Mon, 17 Jul 2023 02:42:20 -0700 (PDT) Received: from localhost (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id 2-20020a05600c248200b003faef96ee78sm7662349wms.33.2023.07.17.02.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Jul 2023 02:42:20 -0700 (PDT) From: Javier Martinez Canillas To: Geert Uytterhoeven , Thomas Zimmermann Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/ssd130x: Fix an oops when attempting to update a disabled plane In-Reply-To: References: <20230713163213.1028952-1-javierm@redhat.com> Date: Mon, 17 Jul 2023 11:42:19 +0200 Message-ID: <87h6q2kh6s.fsf@minerva.mail-host-address-is-not-set> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Geert Uytterhoeven writes: Hello Geert and Thomas, > Hi Thomas, > > On Mon, Jul 17, 2023 at 10:48=E2=80=AFAM Thomas Zimmermann wrote: [...] >> >> After some discussion on IRC, I'd suggest to allocate the buffer >> somewhere within probe. So it will always be there when the plane code r= uns. >> >> A full fix would be to allocate the buffer memory as part of the plane >> state and/or the plane's atomic_check. That's a bit more complicated if >> you want to shared the buffer memory across plane updates. > > Note that actually two buffers are involved: data_array (monochrome, > needed for each update), and buffer (R8, only needed when converting > from XR24 to R1). > > For the former, I agree, as it's always needed. > For the latter, I'm afraid it would set a bad example: while allocating > a possibly-unused buffer doesn't hurt for small displays, it would > mean wasting 1 MiB in e.g. the repaper driver (once it has gained > support for R1 ;^). > Maybe another option is to allocate on the struct drm_mode_config_funcs .fb_create callback? That way, we can get the mode_cmd->pixel_format and determine if only "data_array" buffer must be allocated or also "buffer". > Gr{oetje,eeting}s, > > Geert > > --=20 > Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m6= 8k.org > > In personal conversations with technical people, I call myself a hacker. = But > when I'm talking to journalists I just say "programmer" or something like= that. > -- Linus Torvalds > --=20 Best regards, Javier Martinez Canillas Core Platforms Red Hat