From: Michal Wajdeczko <michal.wajdeczko@intel.com>
To: "Cavitt, Jonathan" <jonathan.cavitt@intel.com>,
"intel-xe@lists.freedesktop.org" <intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH v2 1/7] drm/xe: Introduce const cast helper
Date: Wed, 17 Jul 2024 23:38:32 +0200 [thread overview]
Message-ID: <3bb0e3ca-25f2-413e-bb94-d264eba2cd83@intel.com> (raw)
In-Reply-To: <CH0PR11MB5444E1B66CFF7EDFAA997B68E5A32@CH0PR11MB5444.namprd11.prod.outlook.com>
On 17.07.2024 22:07, Cavitt, Jonathan wrote:
> -----Original Message-----
> From: Intel-xe <intel-xe-bounces@lists.freedesktop.org> On Behalf Of Michal Wajdeczko
> Sent: Wednesday, July 17, 2024 12:52 PM
> To: intel-xe@lists.freedesktop.org
> Cc: Wajdeczko, Michal <Michal.Wajdeczko@intel.com>
> Subject: [PATCH v2 1/7] drm/xe: Introduce const cast helper
>>
>> Typically we want to preserve pointer constness when converting
>> from one xe pointer to another, but in some rare cases, like kunit
>> parameter conversions, we might want to discard this constness.
>> Add a helper that we will use to clearly indicate our intention.
>>
>> Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
>> ---
>> drivers/gpu/drm/xe/xe_device.h | 5 +++++
>> 1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/xe/xe_device.h b/drivers/gpu/drm/xe/xe_device.h
>> index 0a2a3e7fd402..c2b1f9f066bd 100644
>> --- a/drivers/gpu/drm/xe/xe_device.h
>> +++ b/drivers/gpu/drm/xe/xe_device.h
>> @@ -20,6 +20,11 @@ static inline struct xe_device *pdev_to_xe_device(struct pci_dev *pdev)
>> return pci_get_drvdata(pdev);
>> }
>>
>> +static inline struct xe_device *xe_device_const_cast(const struct xe_device *xe)
>> +{
>> + return pdev_to_xe_device(to_pci_dev(xe->drm.dev));
>> +}
>
> This function is used in the next patch and no others. It may or may not be
> better to have this patch and the next squashed together, since that's where
> this function is used, but I can see the argument go either way.
This _other_ argument was that this helper is not strictly designed for
explicit use by those new kunit helpers, or it can be implemented in a
different way, so IMO it deserved standalone patch in a series where it
was actually used for the first time.
>
> Just something to consider. Not blocking.
>
> Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
> -Jonathan Cavitt
Thanks!
>
>> +
>> static inline struct xe_device *ttm_to_xe_device(struct ttm_device *ttm)
>> {
>> return container_of(ttm, struct xe_device, ttm);
>> --
>> 2.43.0
>>
>>
next prev parent reply other threads:[~2024-07-17 21:38 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-17 19:51 [PATCH v2 0/7] Convert live tests to parameterized style Michal Wajdeczko
2024-07-17 19:51 ` [PATCH v2 1/7] drm/xe: Introduce const cast helper Michal Wajdeczko
2024-07-17 20:07 ` Cavitt, Jonathan
2024-07-17 21:38 ` Michal Wajdeczko [this message]
2024-07-19 16:32 ` Lucas De Marchi
2024-07-19 16:55 ` Michal Wajdeczko
2024-07-19 17:06 ` Lucas De Marchi
2024-07-17 19:51 ` [PATCH v2 2/7] drm/xe/tests: Add helpers for use in live tests Michal Wajdeczko
2024-07-17 20:14 ` Cavitt, Jonathan
2024-07-19 16:37 ` Lucas De Marchi
2024-07-19 17:20 ` Michal Wajdeczko
2024-07-17 19:51 ` [PATCH v2 3/7] drm/xe/tests: Convert xe_bo " Michal Wajdeczko
2024-07-17 20:15 ` Cavitt, Jonathan
2024-07-17 19:51 ` [PATCH v2 4/7] drm/xe/tests: Convert xe_dma_buf " Michal Wajdeczko
2024-07-17 20:17 ` Cavitt, Jonathan
2024-07-17 21:54 ` Michal Wajdeczko
2024-07-17 19:51 ` [PATCH v2 5/7] drm/xe/tests: Convert xe_migrate " Michal Wajdeczko
2024-07-17 20:17 ` Cavitt, Jonathan
2024-07-17 19:51 ` [PATCH v2 6/7] drm/xe/tests: Convert xe_mocs " Michal Wajdeczko
2024-07-17 20:18 ` Cavitt, Jonathan
2024-07-19 16:40 ` Lucas De Marchi
2024-07-17 19:51 ` [PATCH v2 7/7] drm/xe/tests: Skip xe_mocs live tests on VF device Michal Wajdeczko
2024-07-17 20:19 ` Cavitt, Jonathan
2024-07-19 16:41 ` Lucas De Marchi
2024-07-17 19:58 ` ✓ CI.Patch_applied: success for Convert live tests to parameterized style (rev2) Patchwork
2024-07-17 19:59 ` ✓ CI.checkpatch: " Patchwork
2024-07-17 20:00 ` ✓ CI.KUnit: " Patchwork
2024-07-17 20:12 ` ✓ CI.Build: " Patchwork
2024-07-17 20:14 ` ✓ CI.Hooks: " Patchwork
2024-07-17 20:16 ` ✓ CI.checksparse: " Patchwork
2024-07-17 20:40 ` ✗ CI.BAT: failure " Patchwork
2024-07-17 21:34 ` Michal Wajdeczko
2024-07-18 1:53 ` ✗ CI.FULL: " Patchwork
2024-07-18 7:11 ` Michal Wajdeczko
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=3bb0e3ca-25f2-413e-bb94-d264eba2cd83@intel.com \
--to=michal.wajdeczko@intel.com \
--cc=intel-xe@lists.freedesktop.org \
--cc=jonathan.cavitt@intel.com \
/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.