From patchwork Sun Dec 15 20:53:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= X-Patchwork-Id: 13908970 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 3C5B3E7717F for ; Sun, 15 Dec 2024 20:53:59 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D7D310E2D6; Sun, 15 Dec 2024 20:53:55 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="kA4HoXG3"; dkim-atps=neutral Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) by gabe.freedesktop.org (Postfix) with ESMTPS id A403210E042; Sun, 15 Dec 2024 20:53:53 +0000 (UTC) Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-5d3cd821c60so455555a12.3; Sun, 15 Dec 2024 12:53:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734296032; x=1734900832; darn=lists.freedesktop.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=2+FqJZ0WnN20yWus5paC8TaBuCsMhAhFdtfoZXH3IvA=; b=kA4HoXG3yBI/9+GfU2hy0T8U7YcLQMl0Ic0lIX4D+civeVgOGwdEWCZL8nI0s3e4LH fzow93DdMininQK8TEMh6CXL7y/GG4k96JVS/7d2NlMowVkmdRfZeOgg7DuzBD4o3tKx 8Dog9509MZY9hekFlOp0dzNDF+pkqRPjQtYzmGuUlDcfkZXXGKKVImZDa0QF4bGeaBAE GSkj8BLkAVD7ewDPTIFlN5zjfj2Zh+cAx0Yq4lki7CDPHEOFPOx/XLLIEJmYOIXc1w8K zWVE56F28vpiW/Zrnb7huAFLJHJvous8dt5awUNjdCvWzw00wrHdWNfwb5jPijkfk7LL hgjw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734296032; x=1734900832; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=2+FqJZ0WnN20yWus5paC8TaBuCsMhAhFdtfoZXH3IvA=; b=hvudNwoVM9mOUJpYkQJ9oYsrbmAHb57cW408lzmlKJUPQH0VayMpKCqetH3hRmvqxp 6V3nlx4ukLRvSYTuBTP5oFvD1ix5/cDns+iAtvpAUTKJBHM6RgScgxGH9GGYdc80OCUB BV0AgWbv6TbuRmXlbu8vww8Qhffjuc6y88XC6qaaUumYjZQgJOU7e1KMPIGhcuiegz9i XlyopoxJMNgRMUBfI/E4oowWvMTB9WQuzw8Lsi/U8nViunMAE2+20PBq7q4kkZbQLEhC kf7rOB8Vgq5KX2MwfSl4mcrvmBLCBQrHObCUFzj5qbCHiWLu+GgsuXfIfUWq03zEjCCD f1Vg== X-Forwarded-Encrypted: i=1; AJvYcCWhRUtZ0c11BYOJHIwqxDBApgmr7IyBLh7IgVDzmxA6IhxuthI75kBXVkgn+cT9+fIsy85TSpBH@lists.freedesktop.org, AJvYcCXW6+CJWdIpNRuFG6SK+/UHetky9ISby5iiNSeNzd10j7Pth+vjVy4kGuiKskbc/dYX85Fh4z1d1Ic=@lists.freedesktop.org X-Gm-Message-State: AOJu0Yyh8yonIHpQPLVsmSmXEcoTAEP7VJUYaVT+W6Jeh3gzDi9p82Y4 RwJYCmM0kD7lsGKxQSxcYa9T7J2pMnXUpdv4YSJubixaPYoiRT092wMA6kpIek82LbaCa5kfDDU RhbsSZYtigsbiUHUCPMJaGWDlHjPF7J6Y X-Gm-Gg: ASbGnct4vD7QcR2ySglwnrmBN1OXD+yVjX33VUJ6CFTQnZVRE1jBrPYIxZdotbp2Dfk uuFswWl9bjHj6u27AHEDh3TTJsJ2DWD9MWAmepM1J X-Google-Smtp-Source: AGHT+IEU63Y28K2w7blcYDp/+dS0AGZliyLQ776SYz1U0vvW1jEGL9cB7LS4hbDRrHeb+if+EQZD/SMst7LEzfMgDI4= X-Received: by 2002:a05:6402:50cc:b0:5cf:f1fd:c688 with SMTP id 4fb4d7f45d1cf-5d63c2e81f5mr3482687a12.1.1734296030000; Sun, 15 Dec 2024 12:53:50 -0800 (PST) MIME-Version: 1.0 From: =?utf-8?b?TWFyZWsgT2zFocOhaw==?= Date: Sun, 15 Dec 2024 15:53:14 -0500 Message-ID: Subject: [PATCH] drm/fourcc: add LINEAR modifiers with an exact pitch alignment To: dri-devel , amd-gfx mailing list , ML Mesa-dev X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" The comment explains the problem with DRM_FORMAT_MOD_LINEAR. Signed-off-by: Marek Olšák diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index 78abd819fd62e..8ec4163429014 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -484,9 +484,27 @@ extern "C" { * modifier (e.g. not setting DRM_MODE_FB_MODIFIERS in the DRM_ADDFB2 ioctl), * which tells the driver to also take driver-internal information into account * and so might actually result in a tiled framebuffer. + * + * WARNING: + * There are drivers out there that expose DRM_FORMAT_MOD_LINEAR, but only + * support a certain pitch alignment and can't import images with this modifier + * if the pitch alignment isn't exactly the one supported. They can however + * allocate images with this modifier and other drivers can import them only + * if they support the same pitch alignment. Thus, DRM_FORMAT_MOD_LINEAR is + * fundamentically incompatible across devices and is the only modifier that + * has a chance of not working. The PITCH_ALIGN modifiers should be used + * instead. */ #define DRM_FORMAT_MOD_LINEAR fourcc_mod_code(NONE, 0) +/* Linear layout modifiers with an explicit pitch alignment in bytes. + * Exposing this modifier requires that the pitch alignment is exactly + * the number in the definition. + */ +#define DRM_FORMAT_MOD_LINEAR_PITCH_ALIGN_64B fourcc_mod_code(NONE, 1)