Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp405137pxb; Mon, 13 Sep 2021 23:25:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyRIsz0mJhN0qIBdt93vfqrkOoyKKQ+FNhIGltXNyISvw8cKsBMfa0GefzK4s2aNcWhruSF X-Received: by 2002:a02:94e4:: with SMTP id x91mr13184864jah.99.1631600706550; Mon, 13 Sep 2021 23:25:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631600706; cv=none; d=google.com; s=arc-20160816; b=LodEtlaV/dFk06K0fQ7VObd+Z9p234QON/ctdDQbf6ADCoXrcCT1/PhaOGeREzEpVw 4L+r2nRDLbk3UHQMai2Fg6D4TTJ9cEKd/7HvXe6Sb/McCM3m08pttd1YNNJVex2Bb1Yp qJ7h35s6qYEcB7VlaGcK/WAfGiwlAEsIPnP9mGyV3gWStiOT6TvlcnvWjy35QGZioFJM MaVc7kObK9ztlININN1sVCrfejaXOwUlVHAr2lh0aes6HXTOfFtuGoMM38FI+Rd2Q/qs lE0vVquJ+Zc7cxbi2EoiuDqb2gGfCKWIJu4tCbwadeRws5YzXAktvyzFaRW9DhH9B0xa TUJQ== 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:subject:cc:to:from; bh=/Ww9x8uw5+MfhdFSjw+9z0DzwXSpL5UVnDbGaKyJb0g=; b=atchMA+gRtU3SZXui5oaDze8AR98lOctgj6pfH5Mwi45llNovDIZoWxfi5fURQ/9va 2/bL6v/Q/67SXSSRJHuFZcyJYKcVP2DeIR2tUZEOXpdxDSOEaBkb7KLH6lbbSvKyxWtO SWctaET88GPmRIrKv3i0G1AUXBtu0Z8qJmnpKQZZNBkjsZx4aJPEUGklwBtBpBMJgoEc yMYnvPcFrZdkjRkdcIC+IoT6M/7zPN6cqjvG8d2hw4/SE1vw361Xglv01bWZ9K6IA3X3 Y05xLkIRkRIeX8gBvX5t0+StU+Zs2yQXtv0tH6/mWJBmPZFBYgZ/aTpOU2y06naO1Ypn V4kw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si8662464ila.148.2021.09.13.23.24.54; Mon, 13 Sep 2021 23:25:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240200AbhINGZQ (ORCPT + 99 others); Tue, 14 Sep 2021 02:25:16 -0400 Received: from mail.loongson.cn ([114.242.206.163]:46664 "EHLO loongson.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239936AbhINGZO (ORCPT ); Tue, 14 Sep 2021 02:25:14 -0400 Received: from localhost.localdomain (unknown [10.2.5.180]) by mail.loongson.cn (Coremail) with SMTP id AQAAf9DxH2v4P0Bh3U0GAA--.10627S2; Tue, 14 Sep 2021 14:23:52 +0800 (CST) From: bibo mao To: Dave Airlie , Gerd Hoffmann Cc: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: [PATCH 1/2] drm/qxl: User page size macro for qxl release bo Date: Tue, 14 Sep 2021 02:23:51 -0400 Message-Id: <20210914062352.6102-1-maobibo@loongson.cn> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf9DxH2v4P0Bh3U0GAA--.10627S2 X-Coremail-Antispam: 1UD129KBjvJXoW7JF4DuF15ArW5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ernel@vger.kernel.org Some architectures have different default page size, this patch replaces hardcoded 4096 with PAGE_SIZE macro, since cmd bo size is page aligned. Signed-off-by: bibo mao --- drivers/gpu/drm/qxl/qxl_release.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/qxl/qxl_release.c b/drivers/gpu/drm/qxl/qxl_release.c index b19f2f00b215..469979cd0341 100644 --- a/drivers/gpu/drm/qxl/qxl_release.c +++ b/drivers/gpu/drm/qxl/qxl_release.c @@ -36,10 +36,10 @@ /* manage releaseables */ /* stack them 16 high for now -drawable object is 191 */ #define RELEASE_SIZE 256 -#define RELEASES_PER_BO (4096 / RELEASE_SIZE) +#define RELEASES_PER_BO (PAGE_SIZE / RELEASE_SIZE) /* put an alloc/dealloc surface cmd into one bo and round up to 128 */ #define SURFACE_RELEASE_SIZE 128 -#define SURFACE_RELEASES_PER_BO (4096 / SURFACE_RELEASE_SIZE) +#define SURFACE_RELEASES_PER_BO (PAGE_SIZE / SURFACE_RELEASE_SIZE) static const int release_size_per_bo[] = { RELEASE_SIZE, SURFACE_RELEASE_SIZE, RELEASE_SIZE }; static const int releases_per_bo[] = { RELEASES_PER_BO, SURFACE_RELEASES_PER_BO, RELEASES_PER_BO }; -- 2.27.0