From patchwork Wed Aug 5 13:43:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 11701897 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7E57B6C1 for ; Wed, 5 Aug 2020 13:43:53 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 592CA2065C for ; Wed, 5 Aug 2020 13:43:53 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ZIScxlAC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 592CA2065C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B22DC6E5D3; Wed, 5 Aug 2020 13:43:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by gabe.freedesktop.org (Postfix) with ESMTPS id 922996E5D3 for ; Wed, 5 Aug 2020 13:43:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596635028; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=QNkBL0MOslnxA1lTPWBDwCkBLDnBYOCw/rGPZtjWTCU=; b=ZIScxlACOASOF8EC8m6eNcqI31nt6wZ8BFjuyIJ67yHc7UTx+Rcc0UUVPAVunqyEPWSnFQ EzMhI86Cit8QzlKlbLspt6cLm8WIZU5ifvMkiTUtliZsmmyKn7Yqx6Ln2Nj50nek3z1i9Q k3V1hBND3IkzG2tmjn6yo6V3sYxCArc= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-357-5SIHGVq2MKSCEcqXSb95lA-1; Wed, 05 Aug 2020 09:43:46 -0400 X-MC-Unique: 5SIHGVq2MKSCEcqXSb95lA-1 Received: by mail-wr1-f72.google.com with SMTP id f7so13582507wrs.8 for ; Wed, 05 Aug 2020 06:43:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=QNkBL0MOslnxA1lTPWBDwCkBLDnBYOCw/rGPZtjWTCU=; b=NJUcuiplhlC9jX+eaRrBA96XumThiRvbSSnEXbtBwF5LSMcozGV4zD/xGMwg2/XMvL wLwmvHDSm128do6im2+lAAf0ozAUtWnK/RkvbZ4phNrVSSdcCWe7kYUinlibcj7bH1AC hyuQnupr3hSknmfSdSU3TXvpc8KyXhg5o8C4vHXdfa07X2JngFPyV/CBl2lfv2r91T3w KNHVY28JncUD4nd7lA/F+2DvnQxiqE3aCQ58QmNPgD0fJnUUwv5xzbVbKbt2riSqAmHm XkIOjFT73LFcSYyLJbnmmDVZ0971ObV+8VWDwnzme1TAaMY3a+WqmA94RKD59NY6oXnF WsXg== X-Gm-Message-State: AOAM533oOCyPZ1vXhLrOMTbROERRxcMND7AlO7T6let6liu4BiyqCT5x c6NrMuXxU1x7fd7hP8QGT7Q3T5CofKVzzmc6FQyiLln6OPIk3JPsHwCgbrl7lyqFsbBa0SoYnMT dNGwqEHznEnud4fAF9WKj9AEfAPRP X-Received: by 2002:adf:f64a:: with SMTP id x10mr2692846wrp.99.1596635025560; Wed, 05 Aug 2020 06:43:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+wOWu/BUGFDnYiFNkYnDk0qc3NvkypKVIbTb4eZBzRtJysZaIOINp4bGehYs8hyi8ABgcfQ== X-Received: by 2002:adf:f64a:: with SMTP id x10mr2692831wrp.99.1596635025403; Wed, 05 Aug 2020 06:43:45 -0700 (PDT) Received: from redhat.com (bzq-79-180-0-181.red.bezeqint.net. [79.180.0.181]) by smtp.gmail.com with ESMTPSA id s131sm2941176wme.17.2020.08.05.06.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 06:43:44 -0700 (PDT) Date: Wed, 5 Aug 2020 09:43:42 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Subject: [PATCH v3 10/38] virtio_gpu: correct tags for config space fields Message-ID: <20200805134226.1106164-11-mst@redhat.com> References: <20200805134226.1106164-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200805134226.1106164-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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: David Airlie , Jason Wang , Cornelia Huck , dri-devel@lists.freedesktop.org, virtualization@lists.linux-foundation.org, Gerd Hoffmann Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Since gpu is a modern-only device, tag config space fields as having little endian-ness. Signed-off-by: Michael S. Tsirkin Reviewed-by: Cornelia Huck Reviewed-by: Gerd Hoffmann --- include/uapi/linux/virtio_gpu.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/include/uapi/linux/virtio_gpu.h b/include/uapi/linux/virtio_gpu.h index 0c85914d9369..ccbd174ef321 100644 --- a/include/uapi/linux/virtio_gpu.h +++ b/include/uapi/linux/virtio_gpu.h @@ -320,10 +320,10 @@ struct virtio_gpu_resp_edid { #define VIRTIO_GPU_EVENT_DISPLAY (1 << 0) struct virtio_gpu_config { - __u32 events_read; - __u32 events_clear; - __u32 num_scanouts; - __u32 num_capsets; + __le32 events_read; + __le32 events_clear; + __le32 num_scanouts; + __le32 num_capsets; }; /* simple formats for fbcon/X use */ From patchwork Wed Aug 5 13:44:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Michael S. Tsirkin" X-Patchwork-Id: 11701901 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 17BBA6C1 for ; Wed, 5 Aug 2020 13:44:58 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id ECCB42312C for ; Wed, 5 Aug 2020 13:44:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="RPxfHWUZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECCB42312C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 46AD16E7D2; Wed, 5 Aug 2020 13:44:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [207.211.31.120]) by gabe.freedesktop.org (Postfix) with ESMTPS id 51DCC6E7D2 for ; Wed, 5 Aug 2020 13:44:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596635094; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=Q6OJqxU8Sp5UYmolvKk955VfeDV9wjAzILoG6EGszAQ=; b=RPxfHWUZXBAKDCfl9zwQSb9YbnYY8vjYenaVj5rYzwYkptKy7b2Ncs28Ne67LO2vsK3VR+ tx/q9fkzEUxrIKrPCMm9Cm9U71kbU956r78OXnR1f9OJi/8gSIWAZ0Ams9GeTRRhPj570t rNIpdJHHrwviDSGnypQ18hfzYpkNj9s= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-311-g7BnX5UOPiibZ5uGqVxOsg-1; Wed, 05 Aug 2020 09:44:53 -0400 X-MC-Unique: g7BnX5UOPiibZ5uGqVxOsg-1 Received: by mail-wm1-f71.google.com with SMTP id t26so2743051wmn.4 for ; Wed, 05 Aug 2020 06:44:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=Q6OJqxU8Sp5UYmolvKk955VfeDV9wjAzILoG6EGszAQ=; b=DjaHOEs89sWNrURLdj/KrJ4ZAQo5OHGKNKhGTVBFBaR+nBqFU3dcgCjintVE8p2VCl 4UbBprdcZSuysKTH1FaMcRg6CGCB24+KUtiqEooYSVx9OwHucwfLblS42zeKDt/KwrV6 Npsfi1ioKdq5r3RsETC8I+VXv2flvwJYwQCYpcz9Wqg366Iu2ZW6UO4aucHnNnk+e+Ij gRtJQNQdk4pgiDvETKQIin3PAKc82tzjR0lUnYinlBg3xYFf6v9Pt7A6WXRYbi75bjP4 hUXNqnIq8rt7RCpxDTBC7C1VBhq7YDws2N3fQ4vNA0Ly/iemYOuPLRBVx/jXOpRjB2g7 bqnA== X-Gm-Message-State: AOAM5318DpMRkLbz2Qrqfn1Y+5Y/Wi05scMHUbbobBB9LWJxRIAoc3x5 s/wKWLwtl1WUdAilGijKoArr0ILTkKC405V2FTsujYOu+12EeT4ySdaKT2xLwYbwqPxkp7kU7Qn AqDHibPGvYYT5M6WCNelqAkXoRCMY X-Received: by 2002:a7b:c24e:: with SMTP id b14mr3637832wmj.128.1596635091102; Wed, 05 Aug 2020 06:44:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIP5APlUbJFDt9cc/+rC2+q+FdTyHsKg7qMGdbwa6FJ2pprZGU/KyCZL+3OX8oaPf4PHL5Hg== X-Received: by 2002:a7b:c24e:: with SMTP id b14mr3637816wmj.128.1596635090938; Wed, 05 Aug 2020 06:44:50 -0700 (PDT) Received: from redhat.com (bzq-79-178-123-8.red.bezeqint.net. [79.178.123.8]) by smtp.gmail.com with ESMTPSA id x4sm3352368wru.81.2020.08.05.06.44.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Aug 2020 06:44:50 -0700 (PDT) Date: Wed, 5 Aug 2020 09:44:48 -0400 From: "Michael S. Tsirkin" To: linux-kernel@vger.kernel.org Subject: [PATCH v3 34/38] drm/virtio: convert to LE accessors Message-ID: <20200805134226.1106164-35-mst@redhat.com> References: <20200805134226.1106164-1-mst@redhat.com> MIME-Version: 1.0 In-Reply-To: <20200805134226.1106164-1-mst@redhat.com> X-Mailer: git-send-email 2.27.0.106.g8ac3dc51b1 X-Mutt-Fcc: =sent Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline 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: David Airlie , dri-devel@lists.freedesktop.org, Gerd Hoffmann , virtualization@lists.linux-foundation.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Virtgpu is modern-only. Use LE accessors for config space. Signed-off-by: Michael S. Tsirkin Reviewed-by: Gerd Hoffmann --- drivers/gpu/drm/virtio/virtgpu_kms.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/virtio/virtgpu_kms.c b/drivers/gpu/drm/virtio/virtgpu_kms.c index 0a5c8cf409fb..4d944a0dff3e 100644 --- a/drivers/gpu/drm/virtio/virtgpu_kms.c +++ b/drivers/gpu/drm/virtio/virtgpu_kms.c @@ -39,8 +39,8 @@ static void virtio_gpu_config_changed_work_func(struct work_struct *work) u32 events_read, events_clear = 0; /* read the config space */ - virtio_cread(vgdev->vdev, struct virtio_gpu_config, - events_read, &events_read); + virtio_cread_le(vgdev->vdev, struct virtio_gpu_config, + events_read, &events_read); if (events_read & VIRTIO_GPU_EVENT_DISPLAY) { if (vgdev->has_edid) virtio_gpu_cmd_get_edids(vgdev); @@ -49,8 +49,8 @@ static void virtio_gpu_config_changed_work_func(struct work_struct *work) drm_helper_hpd_irq_event(vgdev->ddev); events_clear |= VIRTIO_GPU_EVENT_DISPLAY; } - virtio_cwrite(vgdev->vdev, struct virtio_gpu_config, - events_clear, &events_clear); + virtio_cwrite_le(vgdev->vdev, struct virtio_gpu_config, + events_clear, &events_clear); } static void virtio_gpu_init_vq(struct virtio_gpu_queue *vgvq, @@ -165,8 +165,8 @@ int virtio_gpu_init(struct drm_device *dev) } /* get display info */ - virtio_cread(vgdev->vdev, struct virtio_gpu_config, - num_scanouts, &num_scanouts); + virtio_cread_le(vgdev->vdev, struct virtio_gpu_config, + num_scanouts, &num_scanouts); vgdev->num_scanouts = min_t(uint32_t, num_scanouts, VIRTIO_GPU_MAX_SCANOUTS); if (!vgdev->num_scanouts) { @@ -176,8 +176,8 @@ int virtio_gpu_init(struct drm_device *dev) } DRM_INFO("number of scanouts: %d\n", num_scanouts); - virtio_cread(vgdev->vdev, struct virtio_gpu_config, - num_capsets, &num_capsets); + virtio_cread_le(vgdev->vdev, struct virtio_gpu_config, + num_capsets, &num_capsets); DRM_INFO("number of cap sets: %d\n", num_capsets); virtio_gpu_modeset_init(vgdev);