From patchwork Tue Jan 16 17:40:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lucas De Marchi X-Patchwork-Id: 13520990 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 1AED8C47077 for ; Tue, 16 Jan 2024 17:42:51 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CEAF310E5D3; Tue, 16 Jan 2024 17:42:35 +0000 (UTC) Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) by gabe.freedesktop.org (Postfix) with ESMTPS id CEC7E10E0B8; Tue, 16 Jan 2024 17:42:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1705426954; x=1736962954; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Pz/Y7/jWsWrZj6LdlT+g21XnA+qbuAbuQRrOLVHVsEc=; b=UwvZnfW3WdZbhVwgt4zGx6eTDVUDyWK0ynbimnbULJ3theNVC+251usY mdAlzVpbGzPYjkXdQaA9oHt07GUyReGKb8Tv7/APToMYSeVX1HNrHLnwv Ft0uQbdIyTL4ycI+rY1gAjQIy2iub72L3UiezaFj08TZySUKM2kElRwrC XuTZeuzy26sv3knoV5LxZRuzx2f/7ZxOJbPyZyE1GMfcNzyCLF3FZtm4s t1bqJMFavNCmgJXSUwbVU9K9YPRlp3R5XJbhCh1rNBH907rfN7J9KSLof BhTDoZ0M3YxFyebTf1TwmCoqdQP0gqyzYS2j6zX1Cd0LzTb0L4V6yYihE g==; X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="13288221" X-IronPort-AV: E=Sophos;i="6.05,199,1701158400"; d="scan'208";a="13288221" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 09:42:31 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10955"; a="927555522" X-IronPort-AV: E=Sophos;i="6.05,199,1701158400"; d="scan'208";a="927555522" Received: from lucas-s2600cw.jf.intel.com ([10.165.21.196]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Jan 2024 09:42:30 -0800 From: Lucas De Marchi To: intel-xe@lists.freedesktop.org Subject: [PATCH v2 1/5] drm/xe: Use _ULL for u64 division Date: Tue, 16 Jan 2024 09:40:46 -0800 Message-Id: <20240116174050.2435923-2-lucas.demarchi@intel.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240116174050.2435923-1-lucas.demarchi@intel.com> References: <20240116174050.2435923-1-lucas.demarchi@intel.com> MIME-Version: 1.0 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: , Cc: thomas.hellstrom@linux.intel.com, ogabbay@kernel.org, Lucas De Marchi , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use DIV_ROUND_UP_ULL() so it also works on 32bit build. Fixes: dd08ebf6c352 ("drm/xe: Introduce a new DRM driver for Intel GPUs") Signed-off-by: Lucas De Marchi Reviewed-by: Matt Roper --- drivers/gpu/drm/xe/xe_device.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c index a94c0b27f04e..5f5e3c7132d3 100644 --- a/drivers/gpu/drm/xe/xe_device.c +++ b/drivers/gpu/drm/xe/xe_device.c @@ -624,7 +624,7 @@ void xe_device_wmb(struct xe_device *xe) u32 xe_device_ccs_bytes(struct xe_device *xe, u64 size) { return xe_device_has_flat_ccs(xe) ? - DIV_ROUND_UP(size, NUM_BYTES_PER_CCS_BYTE(xe)) : 0; + DIV_ROUND_UP_ULL(size, NUM_BYTES_PER_CCS_BYTE(xe)) : 0; } bool xe_device_mem_access_ongoing(struct xe_device *xe)