dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Zimmermann <tzimmermann@suse.de>
To: hdegoede@redhat.com, airlied@linux.ie, daniel@ffwll.ch,
	sean@poorly.run, maarten.lankhorst@linux.intel.com,
	mripard@kernel.org
Cc: Thomas Zimmermann <tzimmermann@suse.de>, dri-devel@lists.freedesktop.org
Subject: [PATCH 1/3] drm: Add reference to USB device to struct drm_device
Date: Wed, 21 Oct 2020 15:07:30 +0200	[thread overview]
Message-ID: <20201021130732.4048-2-tzimmermann@suse.de> (raw)
In-Reply-To: <20201021130732.4048-1-tzimmermann@suse.de>

We have DRM drivers that operate on USB devices. So far they had
to store a pointer to the USB device structure. Move the reference
into struct drm_device. Putting the USB device into a union with
the PCI data saves a few bytes. Both should mutually exclusive.

Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
---
 include/drm/drm_device.h | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index f4f68e7a9149..9871fcabd720 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -25,6 +25,7 @@ struct inode;
 struct pci_dev;
 struct pci_controller;
 
+struct usb_device;
 
 /**
  * enum drm_switch_power - power state of drm device
@@ -283,16 +284,24 @@ struct drm_device {
 	 */
 	spinlock_t event_lock;
 
-	/** @agp: AGP data */
-	struct drm_agp_head *agp;
+	union {
+		struct {
+			/** @agp: AGP data */
+			struct drm_agp_head *agp;
 
-	/** @pdev: PCI device structure */
-	struct pci_dev *pdev;
+			/** @pdev: PCI device structure */
+			struct pci_dev *pdev;
 
 #ifdef __alpha__
-	/** @hose: PCI hose, only used on ALPHA platforms. */
-	struct pci_controller *hose;
+			/** @hose: PCI hose, only used on ALPHA platforms. */
+			struct pci_controller *hose;
 #endif
+		};
+
+		/** @udev: USB device structure */
+		struct usb_device *udev;
+	};
+
 	/** @num_crtcs: Number of CRTCs on this device */
 	unsigned int num_crtcs;
 
-- 
2.28.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2020-10-21 13:07 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-21 13:07 [PATCH 0/3] drm: Store USB device in struct drm_device Thomas Zimmermann
2020-10-21 13:07 ` Thomas Zimmermann [this message]
2020-10-21 13:07 ` [PATCH 2/3] drm/tiny/gm12u320: Store USB device in struct drm_device.udev Thomas Zimmermann
2020-10-21 13:07 ` [PATCH 3/3] drm/udl: " Thomas Zimmermann
2020-10-21 20:01 ` [PATCH 0/3] drm: Store USB device in struct drm_device Daniel Vetter
2020-10-21 20:05   ` Daniel Vetter
2020-10-22  9:20 ` Hans de Goede
2020-10-22  9:30   ` Thomas Zimmermann
2020-10-22 10:17     ` Hans de Goede
2020-10-22 10:57       ` Thomas Zimmermann
2020-10-22 11:32         ` Hans de Goede

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201021130732.4048-2-tzimmermann@suse.de \
    --to=tzimmermann@suse.de \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hdegoede@redhat.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=sean@poorly.run \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox