From patchwork Sun Jun 2 21:39:47 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 801115 Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2FF012574D for ; Sun, 2 Jun 2024 21:39:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364396; cv=none; b=arEsWCsOAU//gTkLNywWtorOayKTn6L2zhTHUEdqMDFbkqU+ztUYWZP3cjDTl1WW8/1P5mADUN/0055nEnkn82u75h8GaDa9XzMynGMqjHwFSGYrXA1ZLNmTEw6J1kbweSBYhHdNhp8Cv0Miau4bdKeHTnnw/5nRfWCDk2iS9Qo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364396; c=relaxed/simple; bh=nHy/s501BKISDY/viUTlwbtLfmlHRF5tf45zr5mVRjI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=UCpuTlAGAgmbaWOJ3/JsOfJ09KtjqJgwJIigIcWgIBN7FSlx8zFTrEl8vPfUimars9hiNUiRl3EkGqjyUPX+vP26WmwWoT/fo9WbCGre0pG6DP7kvkNbg6bCInAy1SnNcJ+/ajRM93Z1vFUXWp4G57kUEJJecO3YNjnAsH2zOqM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=BF2K5T7H; arc=none smtp.client-ip=209.85.167.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="BF2K5T7H" Received: by mail-lf1-f48.google.com with SMTP id 2adb3069b0e04-52b894021cbso2920140e87.0 for ; Sun, 02 Jun 2024 14:39:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717364392; x=1717969192; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Axn0CffF4ZXu41BfYhRYHrbH241ZyeeHoXr5qagjCJ0=; b=BF2K5T7Hd9CNfnwhKGOyXEHlWm4+YvKSzhwsTUpbt7/HXnQuV+5sdTCs43L0F6cHeL X4PJYIwW08Hf89mZe3ougQhubAQU0dUyCS8oQ6pQcXRr51vceV17r+Te6+wOuGiS9LoN LAhFK+ooLH33/aNyye2MypKnIlFshFiIMoDeGFkfFJHrIn0Hr10KyDj3IILeAMLlyanv JcuC2H0HAF+YQ+0LGC6ii4GkGTNx+bLm0uZ+qpjw1tVZE1HNb77yjAM+IbcmbdPP7Xtp pncECtt4V3i/QqJMJ+Vmmm25QyDwVkfz4FaiS03an0GyZnBUdNhKAAhX4prRkQPoZL7Y BQ/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717364392; x=1717969192; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Axn0CffF4ZXu41BfYhRYHrbH241ZyeeHoXr5qagjCJ0=; b=i8sUsFB8l4fZLApF53To5fhcdrdPRVAG0+2yY6UNtn5uJsuc8leDF2jtb9zfGaYG4w PkUSnPNDp8pHPRHWkfwTzy44bFsrssJ2L8S2ZERI+vfVgLEAUQxW7tPVeJMK09L3KMmp 8WIcwVWYPcM85FPRlRIHkD3i5mD9QCayo5vlSyiiFzLALGxjvxa4nzbhHfNk7ilyz3lF /G1VZZfmF3Ge34kctykconBibRb9rGoTcaioQgPk6AYGp0uU6YjjHp0LFhmEaDyikZV6 qhObfiJHlSiHiAn4tFafpABtyb2zJIf9Q6KeLUE46ljDKA2gyAgr9IA/om+SNU9nnJ8/ 4HbA== X-Forwarded-Encrypted: i=1; AJvYcCWwQKvSKqFWICCGeHRlU1LmrBVLkvd9l28n9FPpOTGWCmQdUd32X2RPhFNPHI8rQS6SNTWq2AI5CUqJhgEQ6izXzCE7ljJnHTFMpE/vIA== X-Gm-Message-State: AOJu0Ywg7LwJi8Iw1o03T4P8Ot6gOnFcTsT2IcEvpdbhw1OaBVHvlbQx EAF3YgHEMVY5ETn/6yga0nyfq/UnoPTZb8oaT3/TbkLjBqwsb8j6gaXDYjfWWqraOjU8wTudT3V u X-Google-Smtp-Source: AGHT+IFfReYRhO/HiJhMNiFndyCOAnoEs/0TBIkJ4a6aBxNSnQZ3JaNQvEPnqjZNZRCjA4ePM7CNwA== X-Received: by 2002:a19:ca17:0:b0:528:649b:d7bb with SMTP id 2adb3069b0e04-52b8949e1a9mr4408779e87.0.1717364392118; Sun, 02 Jun 2024 14:39:52 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b84d3f648sm1021563e87.73.2024.06.02.14.39.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 14:39:51 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 03 Jun 2024 00:39:47 +0300 Subject: [PATCH v2 1/9] drm/msm/dpu: drop dpu_format_check_modified_format Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-dpu-mode-config-width-v2-1-16af520575a6@linaro.org> References: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> In-Reply-To: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: Abel Vesa , Johan Hovold , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=4184; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=nHy/s501BKISDY/viUTlwbtLfmlHRF5tf45zr5mVRjI=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmXOakbZRQAWT1SrHe2d4rp3wBk6oRcDx5dtv92 q7JRPvfocyJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlzmpAAKCRCLPIo+Aiko 1T+5B/935Z6X8ffnw1vTDzVAMCOqiaH0eDbY03Q5LjZT49O5xZEuZe15kolZhjlB6mgWpF5PbR/ CSI4fUcTPvN9h4v6TOkwldQJXXV+PcUBprbMFuMOD/9T3O5SL+aLJIKnw9mwGZmWIqXLcePiFyq 0MFiprqUusppYPnWSB2aAJgbu6ExTjTBPxYWZq33Um+qKGl9ls32tW+HnA1EObepxmn67ef7Nzk wd6gM5mVXWbZwq/dNEOGSYHZ6bDF7bfNfRCHBSh6GQD1BbHGC9JSzo7puXZpNOLpMyyf2MtYEGV Eq4nfvxZo+KvOEQGdB5h03JDeX5Q3y5pU2n/ptJVmW7daxAh X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The msm_kms_funcs::check_modified_format() callback is not used by the driver. Drop it completely. Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 43 ----------------------------- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h | 16 ----------- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 1 - drivers/gpu/drm/msm/msm_kms.h | 6 ---- 4 files changed, 66 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c index 6b1e9a617da3..027eb5ecff08 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c @@ -423,46 +423,3 @@ int dpu_format_populate_layout( return ret; } - -int dpu_format_check_modified_format( - const struct msm_kms *kms, - const struct msm_format *fmt, - const struct drm_mode_fb_cmd2 *cmd, - struct drm_gem_object **bos) -{ - const struct drm_format_info *info; - struct dpu_hw_fmt_layout layout; - uint32_t bos_total_size = 0; - int ret, i; - - if (!fmt || !cmd || !bos) { - DRM_ERROR("invalid arguments\n"); - return -EINVAL; - } - - info = drm_format_info(fmt->pixel_format); - if (!info) - return -EINVAL; - - ret = dpu_format_get_plane_sizes(fmt, cmd->width, cmd->height, - &layout, cmd->pitches); - if (ret) - return ret; - - for (i = 0; i < info->num_planes; i++) { - if (!bos[i]) { - DRM_ERROR("invalid handle for plane %d\n", i); - return -EINVAL; - } - if ((i == 0) || (bos[i] != bos[0])) - bos_total_size += bos[i]->size; - } - - if (bos_total_size < layout.total_size) { - DRM_ERROR("buffers total size too small %u expected %u\n", - bos_total_size, layout.total_size); - return -EINVAL; - } - - return 0; -} diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h index 210d0ed5f0af..ef1239c95058 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h @@ -31,22 +31,6 @@ static inline bool dpu_find_format(u32 format, const u32 *supported_formats, return false; } -/** - * dpu_format_check_modified_format - validate format and buffers for - * dpu non-standard, i.e. modified format - * @kms: kms driver - * @msm_fmt: pointer to the msm_fmt base pointer of an msm_format - * @cmd: fb_cmd2 structure user request - * @bos: gem buffer object list - * - * Return: error code on failure, 0 on success - */ -int dpu_format_check_modified_format( - const struct msm_kms *kms, - const struct msm_format *msm_fmt, - const struct drm_mode_fb_cmd2 *cmd, - struct drm_gem_object **bos); - /** * dpu_format_populate_layout - populate the given format layout based on * mmu, fb, and format found in the fb diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index 1955848b1b78..0d1dcc94455c 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -981,7 +981,6 @@ static const struct msm_kms_funcs kms_funcs = { .complete_commit = dpu_kms_complete_commit, .enable_vblank = dpu_kms_enable_vblank, .disable_vblank = dpu_kms_disable_vblank, - .check_modified_format = dpu_format_check_modified_format, .destroy = dpu_kms_destroy, .snapshot = dpu_kms_mdp_snapshot, #ifdef CONFIG_DEBUG_FS diff --git a/drivers/gpu/drm/msm/msm_kms.h b/drivers/gpu/drm/msm/msm_kms.h index 1e0c54de3716..e60162744c66 100644 --- a/drivers/gpu/drm/msm/msm_kms.h +++ b/drivers/gpu/drm/msm/msm_kms.h @@ -92,12 +92,6 @@ struct msm_kms_funcs { * Format handling: */ - /* do format checking on format modified through fb_cmd2 modifiers */ - int (*check_modified_format)(const struct msm_kms *kms, - const struct msm_format *msm_fmt, - const struct drm_mode_fb_cmd2 *cmd, - struct drm_gem_object **bos); - /* misc: */ long (*round_pixclk)(struct msm_kms *kms, unsigned long rate, struct drm_encoder *encoder); From patchwork Sun Jun 2 21:39:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 801114 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A6DA529401 for ; Sun, 2 Jun 2024 21:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364397; cv=none; b=D9b9Ko2a0HTv4srOzcS5RGjH8XjzjH7aa2qIYXBGuN0g+hqk9/AXIJlimu1AvJD82lZLiGPsK4wmL9JbLeKMPqXdfjEPmVwYrupXinP0bbojxDoGZfoG8DVT5Zr3qpElYH8Zkz9ZOCBkJyRshM0lgjIq6OPDMcuWbBQQ/vn8sMY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364397; c=relaxed/simple; bh=jDftnbrj2pWC+/GjrBG3nHnjwOHiP63BF0nUNAmtu+4=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=TRFBhHMFO5TaSVQAhwtoetqlZ3Abp+bnACcUzdeCaPJpPshly2mVf+LMY0F1tpQOXajyip2o0nNZLygr3orx6NqG4uwa65zwMTsA27gfSgdQGZO9UGwPctwYb+Mk/d0wkVLIkk8FZ45k+w+45GxrygfyK7GYHNiZT33r6E8ATx8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=X/FGFi/x; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="X/FGFi/x" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52b82d57963so3650106e87.2 for ; Sun, 02 Jun 2024 14:39:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717364393; x=1717969193; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=XPP7TmA+2loPDbWoPi/CAkxj5Sf30vQLf/NX5YqEivU=; b=X/FGFi/xx6JFdC252jbwkigySB1T4tWQ66WOILEClLFg5e6b8DLVrmTcb8h1DV/qcb 3XOy0+IUfABM2tFCrwFFrImZhEB9OM4OlkRljY5bT25+XyYho9VAnu/h2gEdCV0MwR1b Q8JJreI+gKYD2ygtwNh8/8aOLVlZZp5rXaoVOK9jbppSRwzCnNp2f225J3AP0oMvLCja rDTzYt1hRbYsqy+aMP0XDKRvwzFRzGyyucGs/Ch3nd6WJut9oD2+A8lBwFir/jR8A4t7 NCZfgOVMDE8RyXjrON1fRW7ygohpXTqqezE3da1UrKehjmeuprTVmc9t0rEiSpMxda5f aajw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717364393; x=1717969193; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=XPP7TmA+2loPDbWoPi/CAkxj5Sf30vQLf/NX5YqEivU=; b=f+JuJpSQj4R7iiYX4YMwYmvN4Q1RN8nMEtQSvgP/O+QuUdvqTPA/lFnVF1nqnQ57xU tKbCdF8E7nskFH3AvYD6M505/NwhIaCQdfhpWI/NLUStzz9KVpnzh0k1FotBIiJoVGl9 jqztUKPuH5mqWucWyV1uYnlKd3AKJW6qTvshvE9bBqH/d+cmeiicEiMLs+CBU03z82SP H3livMLlYweHbpOW1vwpf3Zl/QlgFd5Hgsk0UkniHodE1yzXNfluxSBuLzo+KxpqUqeK NPQn/aq65o4gSfwDpVCED4suNMkR3z72XiedmigkxD5pmdru1+cTGW6uzn7o8U1RYcCL R+Mg== X-Forwarded-Encrypted: i=1; AJvYcCWHfSJI8K+nELDkCttaJlI1VGGoGUTiwkKCXIhmDzG8X8xt2YPVOcawJ4y+AXng7E47Quj91f3q98u9fTdsGdlChJB5J60Jjt4thHvWBg== X-Gm-Message-State: AOJu0Yysr6gaHw0Ce7U8g5CXN9e3OA2LVOACsMXUbpaGxaZlSDGdYKqP YtPKFhwjCZYQ+3QHa3ELDBPuPpYsnSOZBXpt6DAXcU4dXOtygTjk0cL85qXFZIGXJd6+P6/7IU0 s X-Google-Smtp-Source: AGHT+IEbxYhfr5BWh0fY46RehGCiDe1M1me+3HU/84kF94fWyajmCzJKEqCdJbVVi31oObLZ+j1wnA== X-Received: by 2002:ac2:5226:0:b0:51b:214c:5239 with SMTP id 2adb3069b0e04-52b897039f7mr4247950e87.62.1717364393634; Sun, 02 Jun 2024 14:39:53 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b84d3f648sm1021563e87.73.2024.06.02.14.39.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 14:39:53 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 03 Jun 2024 00:39:49 +0300 Subject: [PATCH v2 3/9] drm/msm/dpu: split dpu_format_populate_layout Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-dpu-mode-config-width-v2-3-16af520575a6@linaro.org> References: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> In-Reply-To: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: Abel Vesa , Johan Hovold , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=6568; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=jDftnbrj2pWC+/GjrBG3nHnjwOHiP63BF0nUNAmtu+4=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmXOalMcxLGyi3hvL/tcFt6Pa0SyDpzweV1gsgR 8F4X4NgvHKJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlzmpQAKCRCLPIo+Aiko 1VJ8B/99Sl3EQgmrIPMsnA5GQ9v5T4fVl61vvtVJFXO291kSCyt7W1itHf2HBNzs8NatqELP1tN bj6YcBuHV/W5NI4RCqQ3VGW+lPx7mbFOmOABGnt6D+XAFf8DQ10EPVOuv9SPsYoghrhXPNEdWhZ uVw51W9A0+sYgtPSNLxB8rrRQUTbcRQSICs+Ys6zXeN/6ICxuQyGrwkFcRSKbaWQGbFEyppQk/3 2G0A8guAM/ZoiBmQgEG1Z74PCnSTpxIuVrrXjIE7lDGdwPWuApB9QI7VkFmNqRP9ND8hGHXFU4p hspwe9jevPUlH0w3dqcw5ylnkxjyxBMlxFn1L5s+4km6Z/yL X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A Split dpu_format_populate_layout() into addess-related and pitch/format-related parts. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c | 8 +++- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 45 ++++++++++++---------- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h | 8 +++- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 12 ++++-- 4 files changed, 46 insertions(+), 27 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c index d3ea91c1d7d2..ccf2d030cf20 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder_phys_wb.c @@ -584,7 +584,13 @@ static void dpu_encoder_phys_wb_prepare_wb_job(struct dpu_encoder_phys *phys_enc return; } - ret = dpu_format_populate_layout(aspace, job->fb, &wb_cfg->dest); + ret = dpu_format_populate_plane_sizes(job->fb, &wb_cfg->dest); + if (ret) { + DPU_DEBUG("failed to populate plane sizes%d\n", ret); + return; + } + + ret = dpu_format_populate_addrs(aspace, job->fb, &wb_cfg->dest); if (ret) { DPU_DEBUG("failed to populate layout %d\n", ret); return; diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c index 027eb5ecff08..c6485cb6f1d2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c @@ -93,7 +93,7 @@ static int _dpu_format_get_media_color_ubwc(const struct msm_format *fmt) return color_fmt; } -static int _dpu_format_get_plane_sizes_ubwc( +static int _dpu_format_populate_plane_sizes_ubwc( const struct msm_format *fmt, const uint32_t width, const uint32_t height, @@ -172,7 +172,7 @@ static int _dpu_format_get_plane_sizes_ubwc( return 0; } -static int _dpu_format_get_plane_sizes_linear( +static int _dpu_format_populate_plane_sizes_linear( const struct msm_format *fmt, const uint32_t width, const uint32_t height, @@ -244,27 +244,38 @@ static int _dpu_format_get_plane_sizes_linear( return 0; } -static int dpu_format_get_plane_sizes( - const struct msm_format *fmt, - const uint32_t w, - const uint32_t h, - struct dpu_hw_fmt_layout *layout, - const uint32_t *pitches) +/* + * dpu_format_populate_addrs - populate non-address part of the layout based on + * fb, and format found in the fb + * @fb: framebuffer pointer + * @layout: format layout structure to populate + * + * Return: error code on failure or 0 if new addresses were populated + */ +int dpu_format_populate_plane_sizes( + struct drm_framebuffer *fb, + struct dpu_hw_fmt_layout *layout) { - if (!layout || !fmt) { + const struct msm_format *fmt; + + if (!layout || !fb) { DRM_ERROR("invalid pointer\n"); return -EINVAL; } - if ((w > DPU_MAX_IMG_WIDTH) || (h > DPU_MAX_IMG_HEIGHT)) { + if (fb->width > DPU_MAX_IMG_WIDTH || + fb->height > DPU_MAX_IMG_HEIGHT) { DRM_ERROR("image dimensions outside max range\n"); return -ERANGE; } + fmt = msm_framebuffer_format(fb); + if (MSM_FORMAT_IS_UBWC(fmt) || MSM_FORMAT_IS_TILE(fmt)) - return _dpu_format_get_plane_sizes_ubwc(fmt, w, h, layout); + return _dpu_format_populate_plane_sizes_ubwc(fmt, fb->width, fb->height, layout); - return _dpu_format_get_plane_sizes_linear(fmt, w, h, layout, pitches); + return _dpu_format_populate_plane_sizes_linear(fmt, fb->width, fb->height, + layout, fb->pitches); } static int _dpu_format_populate_addrs_ubwc( @@ -388,7 +399,7 @@ static int _dpu_format_populate_addrs_linear( return 0; } -int dpu_format_populate_layout( +int dpu_format_populate_addrs( struct msm_gem_address_space *aspace, struct drm_framebuffer *fb, struct dpu_hw_fmt_layout *layout) @@ -406,14 +417,6 @@ int dpu_format_populate_layout( return -ERANGE; } - layout->format = msm_framebuffer_format(fb); - - /* Populate the plane sizes etc via get_format */ - ret = dpu_format_get_plane_sizes(layout->format, fb->width, fb->height, - layout, fb->pitches); - if (ret) - return ret; - /* Populate the addresses given the fb */ if (MSM_FORMAT_IS_UBWC(layout->format) || MSM_FORMAT_IS_TILE(layout->format)) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h index ef1239c95058..2f2bff14c0db 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.h @@ -32,7 +32,7 @@ static inline bool dpu_find_format(u32 format, const u32 *supported_formats, } /** - * dpu_format_populate_layout - populate the given format layout based on + * dpu_format_populate_addrs - populate buffer addresses based on * mmu, fb, and format found in the fb * @aspace: address space pointer * @fb: framebuffer pointer @@ -41,9 +41,13 @@ static inline bool dpu_find_format(u32 format, const u32 *supported_formats, * Return: error code on failure, -EAGAIN if success but the addresses * are the same as before or 0 if new addresses were populated */ -int dpu_format_populate_layout( +int dpu_format_populate_addrs( struct msm_gem_address_space *aspace, struct drm_framebuffer *fb, struct dpu_hw_fmt_layout *fmtl); +int dpu_format_populate_plane_sizes( + struct drm_framebuffer *fb, + struct dpu_hw_fmt_layout *layout); + #endif /*_DPU_FORMATS_H */ diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index 9ee178a09a3b..a57853ac70b1 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -674,10 +674,16 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane, } } + ret = dpu_format_populate_plane_sizes(new_state->fb, &pstate->layout); + if (ret) { + DPU_ERROR_PLANE(pdpu, "failed to get format plane sizes, %d\n", ret); + return ret; + } + /* validate framebuffer layout before commit */ - ret = dpu_format_populate_layout(pstate->aspace, - new_state->fb, - &pstate->layout); + ret = dpu_format_populate_addrs(pstate->aspace, + new_state->fb, + &pstate->layout); if (ret) { DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret); return ret; From patchwork Sun Jun 2 21:39:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 801112 Received: from mail-lf1-f47.google.com (mail-lf1-f47.google.com [209.85.167.47]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F1F5978C79 for ; Sun, 2 Jun 2024 21:39:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364399; cv=none; b=KeXYzP/E58ZbzTDCvHfTlDNIOB1Cn3Q8aOZbBY4MiOrjOyerbCNb+AqgPcvakkwkcvTkNzGaKqkB7hwl+felH0b/TkfpvKCPhsRfA7YLIKdPW5ZaDF9knKJvJ+5gqe2I0z86gnqCCce+WPi9HyEH6kWuzAAGkd06XCxEvyUa2To= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364399; c=relaxed/simple; bh=7R5XEZiZYJZfV3EIl1ZYgtEVpBJ16B4QkvSZSHsPzGA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=AhUnPvFEltIJkyVlviWcKybZu61HxPVjkHk4V4eTgIWnBggLIdUh3hCSAgc6QcosjL4H/rqlFz1tAuqGVNVPxtvhdX+ZqjeWR0/b6VTlZgHFxHubD8aYEgm1hYT3gYMhMNXMa+GUAghqw5IAIBO/J50QDxoqijjOBfj/5unR5JI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=xzmizdIQ; arc=none smtp.client-ip=209.85.167.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="xzmizdIQ" Received: by mail-lf1-f47.google.com with SMTP id 2adb3069b0e04-52b8e0e98adso2798545e87.0 for ; Sun, 02 Jun 2024 14:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717364396; x=1717969196; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=phfbeBe/wHZzaldGp3CTSm4jkvtTaBdaWvDYoOuNwVE=; b=xzmizdIQmZn5aK5X2FesfKzkar6NmVVqqr9yZtF43lG0jUsYl++wOetrW/BHptqumF 4nK04F5UcwI9PISTgm9klGl5tZaG9aCWM2YELDxJE4TAxwp3mIZdea3Ijs9xWSxTTJt/ IZv6NFPmpmHYwY1HMUhhb9kA635+N5UZv8EDYL4jENcAJiwQIfOndnVVBe8m/zpWnmuL 4Rh3TpLvW3ORe+A2jGQt3d8KBPD1Ffk7PeRHN/Zsh14CBLv5dYDuo/CePOlCZeZFDRuk Y+x7kpRLpmv9/2fqjLCdIDMujIknO2sBZtGlfL3mkinwO6Cq1zappR4aP+9BzJiqZFn1 md0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717364396; x=1717969196; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=phfbeBe/wHZzaldGp3CTSm4jkvtTaBdaWvDYoOuNwVE=; b=alVzkpQLn9bDQ624fr0X/A3WQR9jQMcCWlcIMxMl916uKICNa1kbERfD/PfADQ3/mr jmUHPhfU4iLZmD1+uQBYUHlGjoXtQyPSX/2xBEo+oxYn3ptKE4g2BFg6GJUb7F8+2PaO VoBHeRH7ZCrLJMPo4FUdvuCypE6JcXuTsuiiUnA/hOtf+5zRKmFkiiBokP86rtcsBJ2Q tqlYhnpCZ+zc4pUh32gF2ZH9zPjOTbd8s/WUeQZfFvqyzfUvOQDhxVR4LPypo4WjPlto /eREVWciiipTrKjHxodbkKZcmagjmEU5ReyWHlGmYMau1yQesKSKm9wtpjD68GXbyh0M 1a/Q== X-Forwarded-Encrypted: i=1; AJvYcCVNW5d/8BNr6hJYjQeV7ygZcCjNjbj7ROnVj8LyzysN259ghGER9Sm11ae22a9JV69T/BxcOOgi1hoTUuQH4vQuktC9m+kXliWII8ZYZw== X-Gm-Message-State: AOJu0YxfWSIa1yimhOcDVCeXUpD7GFUKMUh315arLfNIwZGlWXSIuGHA /2tZzGjWHw3Y6KY5Q8vJI1YqsYSNgq61iLXSU13Fo2piaV4Tt2x2f0gyqy2qOcB3uo209sTn1J5 q X-Google-Smtp-Source: AGHT+IGxRw+MhZXwLFb5hrNZP2u+vz4lRcl9eHFkm0LNpEaolt2v0LY1NkMZg/P1qibIuuIkHVUuAA== X-Received: by 2002:a19:7403:0:b0:523:b272:c73 with SMTP id 2adb3069b0e04-52b89569542mr4347003e87.7.1717364395710; Sun, 02 Jun 2024 14:39:55 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b84d3f648sm1021563e87.73.2024.06.02.14.39.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 14:39:55 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 03 Jun 2024 00:39:52 +0300 Subject: [PATCH v2 6/9] drm/msm/dpu: drop call to _dpu_crtc_setup_lm_bounds from atomic_begin Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-dpu-mode-config-width-v2-6-16af520575a6@linaro.org> References: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> In-Reply-To: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: Abel Vesa , Johan Hovold , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=893; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=7R5XEZiZYJZfV3EIl1ZYgtEVpBJ16B4QkvSZSHsPzGA=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmXOalI8O2Gf9SxPwCXo1gr5Krf6S3U1zjqsmVd jLGSJZ+Jm2JATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlzmpQAKCRCLPIo+Aiko 1fOEB/4g7Qy70gGV6VTyC8hNhK+NYtc6tOoGcIm0WmQZhwToK8OfvQ9J4VMZn0xxqYJvKLLrGt4 9zfYGnpuYD8LKcpDlqmi70GSz/E49iYgwoh4IjJWAg+rxSUikIkWyJjDfFRY0KTtMUxzXrToRni R6EcAlwQnPscsCRBjgsOIRTwS7F4czKxDMnRAWoMUkQF5oGN8wG6oRTUvAn+VTQaS5D9947SX7s kauLgM5n5CwnXNCFChuvJRxxcNKu01o0e6z3RhErUr4SOF7p5UJ3eJCvd5vgH5TCC9+1iq7MOsB NEXyWBfv7jBiO30j+QlkPqtd7uqNmrfWMfwk8zg5Wrr4rm0V X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A The dpu_crtc_atomic_check() already calls _dpu_crtc_setup_lm_bounds(). There is no need to call it from dpu_crtc_atomic_begin(). Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c index 9f2164782844..e3b1e5f55a92 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c @@ -803,8 +803,6 @@ static void dpu_crtc_atomic_begin(struct drm_crtc *crtc, DRM_DEBUG_ATOMIC("crtc%d\n", crtc->base.id); - _dpu_crtc_setup_lm_bounds(crtc, crtc->state); - /* encoder will trigger pending mask now */ drm_for_each_encoder_mask(encoder, crtc->dev, crtc->state->encoder_mask) dpu_encoder_trigger_kickoff_pending(encoder); From patchwork Sun Jun 2 21:39:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 801111 Received: from mail-lf1-f44.google.com (mail-lf1-f44.google.com [209.85.167.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 10BE57B3FD for ; Sun, 2 Jun 2024 21:39:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.44 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364400; cv=none; b=rICO9V/hEBxWWm19yuM4edjhIIHhNBIRwekVDCKRr+bcX9/BCw9bzi+rHsemNrFnXaXrK0HPf7li1+tEE/19NWOseioE9vJjlM+l4s6SaGmtOYCs/g463kbmjsG/x1GXvMNzETnoDjHKDU5WCYGROvni0tzFE0N3nVIeioG/QTo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717364400; c=relaxed/simple; bh=kt+mUO/v24R5t4QFhxIPYKNo9RIjNHA9NWWDdfrHipk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ecU8Auue1j7FlFOcCYJbobp285K8Rp/MA0kJZftMJLiRc2CmYFixo2EN2sCqhRb5jc/lXh4c5M4WiwWjSx4cWC8kW2vOcghNiEUr9V5WIEH8NJ/RtWkTK3gdZM1XM9Nf1s3MxJunjm1Li4q7OxJBpr7qtMF7bXePAIFU58oFItg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=Qcfm5nW6; arc=none smtp.client-ip=209.85.167.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Qcfm5nW6" Received: by mail-lf1-f44.google.com with SMTP id 2adb3069b0e04-52b8b638437so2824257e87.3 for ; Sun, 02 Jun 2024 14:39:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1717364397; x=1717969197; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EcbpVWRjdcbUgJJRZuH7Bn/JQTVuo4vjsCW3dScHVqc=; b=Qcfm5nW6T5vRH6lq49ON3/ODuCbnkW7Xt91lcqrdhkx7U5zuJCsTWmUqGeUBxwCojW 4LUrXMb9UyU21PMLw545FXmXZ46OUQ9gUkjDBcljdGfvwySAEM7fpcuCpG2VL6MeJo4w DrNj8Afsxf2mTrIxtVeU6UitgJoRIwSxABSNqoYAO8SwiU05+D4KIvtmICz+YVItmWao VHjY9qEmBJDQcYii2NBQl88z5pdmpinmSNy5w4aRSDS0IiWJERmcLifegqpVeg3lyu8/ lVmejbBxQI/sVxbTpQzVacDz4vOKOcHaTKd7CxKbZgLZ6pX9IMeWEystXhTvCBA5/+pB vBnQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717364397; x=1717969197; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EcbpVWRjdcbUgJJRZuH7Bn/JQTVuo4vjsCW3dScHVqc=; b=srbVB9UoWlrsOLWJ1q5L96tEkcMSn9Euoigt/Jrz6LnM5z5Ls7cGWXdvHV8A3EGtNM ndthLyJctRgeLyC4AKpYXtCbvbv69ntqLAtTgIUYfS1WdqMSFv73NEIcN+EQUzFXMge+ iJmnlSYnfTD5Kc9kmXUT74CsTnUeVj+UwiLiXScpxSgVL3M3q5oAXLpWtjyCFLunIMHN 1yuciNKPjmYwxcXEYgXGnG9e2JcXVzeJvnB+86Gcs6gNmAZg7pAZqBWpGADd5iHSWlwc m8wX1Ye5HrGXUwyY2LZbgqvADxMUeF9Zdp64EX6mNmiaRWEzcXh3JT49gIgDBZku+utt KRNQ== X-Forwarded-Encrypted: i=1; AJvYcCUPpMjAJTlnvsuIO2YGSEqO0NEFya6tqZu3ubs/mJ4VgkeyQmRbmM2XoYF1FcjflGKWK1TESx8WuNW9uCrqQnE8hBvxxT5IBqTq2GQCOA== X-Gm-Message-State: AOJu0Yy8WHSRDMGc3raGNUI5rVGHdleo3V0dyLrp/JuVq2HODa/CE4zI FQdI/satXejQzGeVi4Tz+p2v/CRFpivH3dIUvy+AQnIBqg0A6SVqLzBSbtjJtBY0IcqXLotoNVg Q X-Google-Smtp-Source: AGHT+IHz60PkWKk1NRMpJcn8TjxRZTtqgum1tGKy+1VleEMZYuUYgpb3OZofDSjCZ7qHmtMWyzKO+A== X-Received: by 2002:a05:6512:3592:b0:523:87b6:2ac2 with SMTP id 2adb3069b0e04-52b896bfd01mr4266965e87.40.1717364397106; Sun, 02 Jun 2024 14:39:57 -0700 (PDT) Received: from umbar.lan ([192.130.178.91]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-52b84d3f648sm1021563e87.73.2024.06.02.14.39.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Jun 2024 14:39:56 -0700 (PDT) From: Dmitry Baryshkov Date: Mon, 03 Jun 2024 00:39:54 +0300 Subject: [PATCH v2 8/9] drm/msm/dpu: merge MAX_IMG_WIDTH/HEIGHT with DPU_MAX_IMG_WIDTH/HEIGHT Precedence: bulk X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20240603-dpu-mode-config-width-v2-8-16af520575a6@linaro.org> References: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> In-Reply-To: <20240603-dpu-mode-config-width-v2-0-16af520575a6@linaro.org> To: Rob Clark , Abhinav Kumar , Sean Paul , Marijn Suijten , David Airlie , Daniel Vetter Cc: Abel Vesa , Johan Hovold , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=2255; i=dmitry.baryshkov@linaro.org; h=from:subject:message-id; bh=kt+mUO/v24R5t4QFhxIPYKNo9RIjNHA9NWWDdfrHipk=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBmXOalyn6cTyjM6xpyhZWng8UYIofhWpakKWUPq +h2aXcd8dGJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCZlzmpQAKCRCLPIo+Aiko 1fDYB/9fA+ZSwXraqbAljD5cg9JXqZZRR+1Gw+8Ov7NP/tRx8yN/hIMDapaQRnCPWZ+UO9k8bdc NHLyrtOpm1iHwR1mom4Ytm1dJpPUXQiQJCr4nxGJlgI5GZNZJDdSDiSHu1TwJuJyyFFzTimHvQr imzVFisFINLY28RRPLMdktZJpKKQzOOvxFl4lOU6tC6CzNhAfx2APRUCMKbZoyiysCUYVUzliVz I/10D4b86ZIG84BgJIGnPJXxYR4bAp1IHYY5FJkUXFvn8s58hNjYq5691UlhCdr7TAc7l8rTuEE Ufnlyam2nISIKlakzFPbc696wveo6RXXvAGr000Bw7tFrnEV X-Developer-Key: i=dmitry.baryshkov@linaro.org; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A dpu_formats.c defines DPU_MAX_IMG_WIDTH and _HEIGHT, while dpu_hw_catalog.h defines just MAX_IMG_WIDTH and _HEIGHT. Merge these constants to remove duplication. Reviewed-by: Abhinav Kumar Signed-off-by: Dmitry Baryshkov --- drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c | 3 --- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 4 ++-- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 4 ++-- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c index c6485cb6f1d2..6d7c4373bf84 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c @@ -13,9 +13,6 @@ #define DPU_UBWC_PLANE_SIZE_ALIGNMENT 4096 -#define DPU_MAX_IMG_WIDTH 0x3FFF -#define DPU_MAX_IMG_HEIGHT 0x3FFF - /* * struct dpu_media_color_map - maps drm format to media format * @format: DRM base pixel format diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h index d1aef778340b..af2ead1c4886 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h @@ -21,8 +21,8 @@ #define DPU_HW_BLK_NAME_LEN 16 -#define MAX_IMG_WIDTH 0x3fff -#define MAX_IMG_HEIGHT 0x3fff +#define DPU_MAX_IMG_WIDTH 0x3fff +#define DPU_MAX_IMG_HEIGHT 0x3fff #define CRTC_DUAL_MIXERS 2 diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c index b5848fae14ce..6000e84598c2 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c @@ -852,8 +852,8 @@ static int dpu_plane_atomic_check(struct drm_plane *plane, fb_rect.y2 = new_plane_state->fb->height; /* Ensure fb size is supported */ - if (drm_rect_width(&fb_rect) > MAX_IMG_WIDTH || - drm_rect_height(&fb_rect) > MAX_IMG_HEIGHT) { + if (drm_rect_width(&fb_rect) > DPU_MAX_IMG_WIDTH || + drm_rect_height(&fb_rect) > DPU_MAX_IMG_HEIGHT) { DPU_DEBUG_PLANE(pdpu, "invalid framebuffer " DRM_RECT_FMT "\n", DRM_RECT_ARG(&fb_rect)); return -E2BIG;