From: Jani Nikula <jani.nikula@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>,
intel-gfx@lists.freedesktop.org, intel-xe@lists.freedesktop.org
Subject: Re: [PATCH 02/10] drm/xe: add kdev_to_xe_device() helper and use it
Date: Tue, 06 Aug 2024 15:10:51 +0300 [thread overview]
Message-ID: <87jzgt6ed0.fsf@intel.com> (raw)
In-Reply-To: <172253051169.5121.1482254642233377824@gjsousa-mobl2>
On Thu, 01 Aug 2024, Gustavo Sousa <gustavo.sousa@intel.com> wrote:
> Quoting Jani Nikula (2024-07-29 11:30:03-03:00)
>>There are enough users for kernel device to xe device conversion, add a
>>helper for it.
>>
>>Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>---
>> drivers/gpu/drm/xe/xe_device.h | 5 +++++
>> drivers/gpu/drm/xe/xe_gsc_proxy.c | 9 ++-------
>> 2 files changed, 7 insertions(+), 7 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
>>index db6cc8d0d6b8..2c96f1b2aafd 100644
>>--- a/drivers/gpu/drm/xe/xe_device.h
>>+++ b/drivers/gpu/drm/xe/xe_device.h
>>@@ -15,6 +15,11 @@ static inline struct xe_device *to_xe_device(const struct drm_device *dev)
>> return container_of(dev, struct xe_device, drm);
>> }
>>
>>+static inline struct xe_device *kdev_to_xe_device(struct device *kdev)
>
> Nitpick: Although there are some places that do it differently, it seems
> it is very common to use "dev" to refer to the generic struct device, so
> I would s/kdev/dev/ here.
I think kdev is often used to distinguish from struct drm_device *dev.
> In any case:
>
> Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Thanks,
Jani.
>
>>+{
>>+ return dev_get_drvdata(kdev);
>>+}
>>+
>> static inline struct xe_device *pdev_to_xe_device(struct pci_dev *pdev)
>> {
>> return pci_get_drvdata(pdev);
>>diff --git a/drivers/gpu/drm/xe/xe_gsc_proxy.c b/drivers/gpu/drm/xe/xe_gsc_proxy.c
>>index aa812a2bc3ed..28e6a7a1d282 100644
>>--- a/drivers/gpu/drm/xe/xe_gsc_proxy.c
>>+++ b/drivers/gpu/drm/xe/xe_gsc_proxy.c
>>@@ -62,11 +62,6 @@ gsc_to_gt(struct xe_gsc *gsc)
>> return container_of(gsc, struct xe_gt, uc.gsc);
>> }
>>
>>-static inline struct xe_device *kdev_to_xe(struct device *kdev)
>>-{
>>- return dev_get_drvdata(kdev);
>>-}
>>-
>> bool xe_gsc_proxy_init_done(struct xe_gsc *gsc)
>> {
>> struct xe_gt *gt = gsc_to_gt(gsc);
>>@@ -345,7 +340,7 @@ void xe_gsc_proxy_irq_handler(struct xe_gsc *gsc, u32 iir)
>> static int xe_gsc_proxy_component_bind(struct device *xe_kdev,
>> struct device *mei_kdev, void *data)
>> {
>>- struct xe_device *xe = kdev_to_xe(xe_kdev);
>>+ struct xe_device *xe = kdev_to_xe_device(xe_kdev);
>> struct xe_gt *gt = xe->tiles[0].media_gt;
>> struct xe_gsc *gsc = >->uc.gsc;
>>
>>@@ -360,7 +355,7 @@ static int xe_gsc_proxy_component_bind(struct device *xe_kdev,
>> static void xe_gsc_proxy_component_unbind(struct device *xe_kdev,
>> struct device *mei_kdev, void *data)
>> {
>>- struct xe_device *xe = kdev_to_xe(xe_kdev);
>>+ struct xe_device *xe = kdev_to_xe_device(xe_kdev);
>> struct xe_gt *gt = xe->tiles[0].media_gt;
>> struct xe_gsc *gsc = >->uc.gsc;
>>
>>--
>>2.39.2
>>
--
Jani Nikula, Intel
next prev parent reply other threads:[~2024-08-06 12:11 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-29 14:30 [PATCH 00/10] drm/xe & drm/i915: drvdata usage changes Jani Nikula
2024-07-29 14:30 ` [PATCH 01/10] drm/xe: use pdev_to_xe_device() instead of pci_get_drvdata() directly Jani Nikula
2024-08-01 16:31 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 02/10] drm/xe: add kdev_to_xe_device() helper and use it Jani Nikula
2024-08-01 16:41 ` Gustavo Sousa
2024-08-06 12:10 ` Jani Nikula [this message]
2024-07-29 14:30 ` [PATCH 03/10] drm/xe/tests: fix drvdata usage Jani Nikula
2024-08-01 16:57 ` Gustavo Sousa
2024-08-06 12:13 ` Jani Nikula
2024-08-06 12:14 ` Jani Nikula
2024-08-07 16:52 ` Lucas De Marchi
2024-07-29 14:30 ` [PATCH 04/10] drm/i915: use pdev_to_i915() instead of pci_get_drvdata() directly Jani Nikula
2024-08-01 17:03 ` Gustavo Sousa
2024-08-01 17:27 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 05/10] drm/i915 & drm/xe: save struct drm_device to drvdata Jani Nikula
2024-08-01 17:38 ` Gustavo Sousa
2024-08-02 8:18 ` Jani Nikula
2024-08-02 12:08 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 06/10] drm/i915: support struct device and pci_dev in to_intel_display() Jani Nikula
2024-08-01 17:46 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 07/10] drm/i915/audio: migrate away from kdev_to_i915() Jani Nikula
2024-08-01 18:03 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 08/10] drm/i915/hdcp: migrate away from kdev_to_i915() in bind/unbind Jani Nikula
2024-08-01 18:03 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 09/10] drm/i915/hdcp: migrate away from kdev_to_i915() in GSC messaging Jani Nikula
2024-08-01 18:09 ` Gustavo Sousa
2024-08-06 14:03 ` Jani Nikula
2024-08-06 14:14 ` Jani Nikula
2024-08-07 19:03 ` Gustavo Sousa
2024-07-29 14:30 ` [PATCH 10/10] drm/xe/display: remove unused compat kdev_to_i915() and pdev_to_i915() Jani Nikula
2024-08-01 18:11 ` Gustavo Sousa
2024-07-29 14:43 ` ✓ CI.Patch_applied: success for drm/xe & drm/i915: drvdata usage changes Patchwork
2024-07-29 14:44 ` ✓ CI.checkpatch: " Patchwork
2024-07-29 14:45 ` ✓ CI.KUnit: " Patchwork
2024-07-29 14:57 ` ✓ CI.Build: " Patchwork
2024-07-29 14:59 ` ✓ CI.Hooks: " Patchwork
2024-07-29 15:00 ` ✗ CI.checksparse: warning " Patchwork
2024-07-29 15:20 ` ✓ CI.BAT: success " Patchwork
2024-07-29 15:20 ` ✗ Fi.CI.SPARSE: warning " Patchwork
2024-07-29 15:46 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-07-29 19:51 ` ✗ CI.FULL: " Patchwork
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=87jzgt6ed0.fsf@intel.com \
--to=jani.nikula@intel.com \
--cc=gustavo.sousa@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.