From patchwork Sun Mar 17 18:01:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frej Drejhammar X-Patchwork-Id: 13594795 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 44571C54E60 for ; Sun, 17 Mar 2024 18:13:17 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9431110E05C; Sun, 17 Mar 2024 18:13:16 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="hjievgPD"; dkim-atps=neutral Received: from mail-lj1-f178.google.com (mail-lj1-f178.google.com [209.85.208.178]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7645410E05C; Sun, 17 Mar 2024 18:13:15 +0000 (UTC) Received: by mail-lj1-f178.google.com with SMTP id 38308e7fff4ca-2d21cdbc85bso50139391fa.2; Sun, 17 Mar 2024 11:13:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710699193; x=1711303993; darn=lists.freedesktop.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=G7LVNnL6i6/3zn/gRTdfjK6M4GpqWD7xH2ioIyRg274=; b=hjievgPDh+QDYp3ndkbDS7zIT3qtdYmnf+hBtMsn/x81Rh1fUjTcap4Osx8ZHPfR1G 6Nh9cxFZWk4rWgxXhdESYtIbhJhjRzOeHjoJ8j3c/ArY4E/x5llM/reb6dvivFYpH71T GyUZpI83uHA0A3KRABwYq6ZzdV6bihS6wHCa4AEQq8r4rCB+LgbeHrTx6o7b6NU9ep3x Uq7babU1BDLPlXO6DrHfA5AWUE7UWy+zxbmAmqGILkE+Pgv0PDWSHEPUM91OKrL4O3Ik CW28a01qubv2ejgWOabvyoeOobgyVshWY7pVRbP038FEZs+UefllHXqZQas6I6vs2Nn3 93zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710699193; x=1711303993; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=G7LVNnL6i6/3zn/gRTdfjK6M4GpqWD7xH2ioIyRg274=; b=iNyK5v2doSrvZhMo0y5wPXMfF7ifEMd1R5W0bbvDB2n7zM/T/AUSVkTTg9mMQoUmr7 cAp1lMgMV3pSI9SCQSqmyLjhlQ0E68e6EIvxshYKHRneuCC1usYzaE04o2Be3F2VP52K gISouy4bfsByCQETDg5i8Ivc58GQEPIc+0lElsigZABxosaJVPSVPz3y/Z+0zAU+XATx OzAsabmL+KMgSsFwUG5HkdrJa2RbpXBoUB4KJGhBsq+S305zc5nTE9V+3qCZcEpflBNz 1Pbw3yW/o5htQ9Lqxv3ff9EK1ToC40EiRHXgfy9GEDP1lQyBw2bFqeaTK/vdk2jS48bG tB/w== X-Forwarded-Encrypted: i=1; AJvYcCXkyK8L8KWNLu+tjlOci8jPsYMlAPZyKlVA6MGs/j13cGRt7UwQimZFBnloKbZEvh06LVgQwq1AwADlrgaLOo1ZQXisn8rBSThgE7xoubmPGh4ITy3dXcygwQKl6sLNl9UKA9xthDpT9652L0k2o34= X-Gm-Message-State: AOJu0YzNHj1T8q6eIla8d1Lx6ZFwuwhY8+5xlOrhd4GcXTjGi+rmT1Vj cdCZlR00BOk0dVUrxtWuqC6FdRMWQABRnaxbcgGFgSGV3G1EBbFRpoB9cSbH1WE= X-Google-Smtp-Source: AGHT+IF8ZFmPuBWIBYTBZW1A2otV1Uh+/U/dVprtMvmGl6rLftI8HvoNZDUqnnwopuBBdtqeX/oM5w== X-Received: by 2002:a2e:3517:0:b0:2d2:ba5a:68d0 with SMTP id z23-20020a2e3517000000b002d2ba5a68d0mr6061404ljz.33.1710699193353; Sun, 17 Mar 2024 11:13:13 -0700 (PDT) Received: from betty.fdsoft.se (213-67-237-183-no99.tbcn.telia.com. [213.67.237.183]) by smtp.gmail.com with ESMTPSA id g29-20020a05651c079d00b002d0acb57c89sm1225398lje.64.2024.03.17.11.13.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Mar 2024 11:13:13 -0700 (PDT) Received: from ester.fdsoft.se ([192.168.1.2]) by betty.fdsoft.se with esmtp (Exim 4.97.1) (envelope-from ) id 1rluq8-000000005e0-1qAX; Sun, 17 Mar 2024 19:02:32 +0100 From: Frej Drejhammar To: dri-devel@lists.freedesktop.org Cc: Frej Drejhammar , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org Subject: [PATCH 11/11] drm/xe: Use drm_driver_legacy_fb_format() for fbdev Date: Sun, 17 Mar 2024 19:01:36 +0100 Message-ID: <261e48bfe34de3612ccaa1dc91ebdfd540635c24.1710698387.git.frej.drejhammar@gmail.com> X-Mailer: git-send-email 2.44.0 In-Reply-To: References: MIME-Version: 1.0 X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Switch to using drm_driver_legacy_fb_format() instead of drm_mode_legacy_fb_format() to use the same logic as for the DRM_IOCTL_MODE_ADDFB ioctl when selecting a framebuffer format. Signed-off-by: Frej Drejhammar Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Thomas Zimmermann Cc: David Airlie Cc: Daniel Vetter Cc: intel-gfx@lists.freedesktop.org Cc: intel-xe@lists.freedesktop.org --- This is an evolved version of the changes proposed in "drm: Don't return unsupported formats in drm_mode_legacy_fb_format" [1] following the suggestions of Thomas Zimmermann. [1] https://lore.kernel.org/all/20240310152803.3315-1-frej.drejhammar@gmail.com/ --- drivers/gpu/drm/xe/display/intel_fbdev_fb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c index 51ae3561fd0d..5bf0841a9f27 100644 --- a/drivers/gpu/drm/xe/display/intel_fbdev_fb.c +++ b/drivers/gpu/drm/xe/display/intel_fbdev_fb.c @@ -32,8 +32,9 @@ struct drm_framebuffer *intel_fbdev_fb_alloc(struct drm_fb_helper *helper, mode_cmd.pitches[0] = ALIGN(mode_cmd.width * DIV_ROUND_UP(sizes->surface_bpp, 8), XE_PAGE_SIZE); - mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, - sizes->surface_depth); + mode_cmd.pixel_format = drm_driver_legacy_fb_format(dev, + sizes->surface_bpp, + sizes->surface_depth); size = mode_cmd.pitches[0] * mode_cmd.height; size = PAGE_ALIGN(size);