From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EA34133B97A for ; Wed, 29 Apr 2026 09:53:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777456405; cv=none; b=t8yHC9Cg6rrJV64ezH18uIMvyHlPF2nB+4NH/le5A3ZwucyJ2DSgUxGgRzI28/GBpysPrShMMr8Fg921sxG07gOO8ciPBlhtEzQJR0Ehd05eQx4C2sLXCeUihUAv3IQfEbIXX/yKNU8F1igos+5VeL5QdwZBtFeZFU26Z9NAtiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777456405; c=relaxed/simple; bh=/ReN6K+0yo9euoyN9evyrR42IX6RvMM/bMgT1hfvlFY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hRcU4w/2djcGs2K3vsmhAkOmbquyJRVxhwj78YApW6BCvm/Mbf5LVnKqREdVshCHM+ggFWk60XgxfR9kQkfctFtNRObRLdsgfoIiKynYBBO8gIAwIa0LQ3CdJJtCSxotDA/OM7l41FBvpa3h0G2M3YXjVJu0+0RnJ7DJzOUVJWY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=S1UQSNmW; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="S1UQSNmW" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777456402; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qq68cDnnkQDnhZ7FI3gXWBcfZHPGoFfOX51hOZJBhgs=; b=S1UQSNmWN1CENfrQv7Y9yncTWsEyHc+gDzmtoC2yPqt7mnD9yxXOmRLMxHzOyuxxEV69Ms 5b0oIuhK4eoytMNGtCHNCU1H02//qOfeBgJg1YIrtFSnQ8laX0uMDRaElV9O7PPtL0rSxN olGf6Z7uPqz5YP9Uj4PcpVi0jAf/Nvo= Received: from mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (ec2-35-165-154-97.us-west-2.compute.amazonaws.com [35.165.154.97]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-288-zKQ7loXTOOy2OOTEaOvsFA-1; Wed, 29 Apr 2026 05:53:13 -0400 X-MC-Unique: zKQ7loXTOOy2OOTEaOvsFA-1 X-Mimecast-MFC-AGG-ID: zKQ7loXTOOy2OOTEaOvsFA_1777456382 Received: from mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.93]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id A22F81800378; Wed, 29 Apr 2026 09:53:02 +0000 (UTC) Received: from f43vm.redhat.corp (headnet01.pony-001.prod.iad2.dc.redhat.com [10.2.32.101]) by mx-prod-int-06.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B47B41800349; Wed, 29 Apr 2026 09:52:58 +0000 (UTC) From: Sergio Lopez To: Chia-I Wu , Jason Wang , "Michael S. Tsirkin" , =?UTF-8?q?Eugenio=20P=C3=A9rez?= , Xuan Zhuo , linux-kernel@vger.kernel.org, Simona Vetter , Dmitry Osipenko , Thomas Zimmermann , David Airlie , Gurchetan Singh , Gerd Hoffmann , virtualization@lists.linux.dev, dri-devel@lists.freedesktop.org, Maxime Ripard , Maarten Lankhorst Cc: Sergio Lopez Subject: [PATCH v2 3/3] drm/virtio: add VIRTGPU_PARAM_BLOB_ALIGNMENT to params Date: Tue, 28 Apr 2026 21:44:50 +0200 Message-ID: <20260428194450.518296-4-slp@redhat.com> In-Reply-To: <20260428194450.518296-1-slp@redhat.com> References: <20260428194450.518296-1-slp@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.93 Add VIRTGPU_PARAM_BLOB_ALIGNMENT as a param that can be read with VIRTGPU_GETPARAM by userspace applications running in the guest to obtain the host's page size and find out the right alignment to be used in shared memory allocations. Signed-off-by: Sergio Lopez --- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 5 +++++ include/uapi/drm/virtgpu_drm.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/gpu/drm/virtio/virtgpu_ioctl.c b/drivers/gpu/drm/virtio/virtgpu_ioctl.c index d0c4edf1eaf4..146ff25396c2 100644 --- a/drivers/gpu/drm/virtio/virtgpu_ioctl.c +++ b/drivers/gpu/drm/virtio/virtgpu_ioctl.c @@ -117,6 +117,11 @@ static int virtio_gpu_getparam_ioctl(struct drm_device *dev, void *data, case VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME: value = vgdev->has_context_init ? 1 : 0; break; + case VIRTGPU_PARAM_BLOB_ALIGNMENT: + if (!vgdev->has_blob_alignment) + return -ENOENT; + value = vgdev->blob_alignment; + break; default: return -EINVAL; } diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h index 9debb320c34b..7d4e4884d942 100644 --- a/include/uapi/drm/virtgpu_drm.h +++ b/include/uapi/drm/virtgpu_drm.h @@ -98,6 +98,7 @@ struct drm_virtgpu_execbuffer { #define VIRTGPU_PARAM_CONTEXT_INIT 6 /* DRM_VIRTGPU_CONTEXT_INIT */ #define VIRTGPU_PARAM_SUPPORTED_CAPSET_IDs 7 /* Bitmask of supported capability set ids */ #define VIRTGPU_PARAM_EXPLICIT_DEBUG_NAME 8 /* Ability to set debug name from userspace */ +#define VIRTGPU_PARAM_BLOB_ALIGNMENT 9 /* Device alignment requirements for blobs */ struct drm_virtgpu_getparam { __u64 param; -- 2.53.0