* [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
@ 2023-03-09 12:37 Jani Nikula
2023-03-09 12:45 ` Christian König
2023-05-16 16:08 ` Thomas Zimmermann
0 siblings, 2 replies; 7+ messages in thread
From: Jani Nikula @ 2023-03-09 12:37 UTC (permalink / raw)
To: dri-devel; +Cc: jani.nikula, intel-gfx, Huang Rui, Christian Koenig
Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
drivers/gpu/drm/ttm/ttm_device.c | 2 +-
include/drm/ttm/ttm_device.h | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
index ae2f19dc9f81..a71bb1362de4 100644
--- a/drivers/gpu/drm/ttm/ttm_device.c
+++ b/drivers/gpu/drm/ttm/ttm_device.c
@@ -190,7 +190,7 @@ EXPORT_SYMBOL(ttm_device_swapout);
* Returns:
* !0: Failure.
*/
-int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
+int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
struct device *dev, struct address_space *mapping,
struct drm_vma_offset_manager *vma_manager,
bool use_dma_alloc, bool use_dma32)
diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
index 56e82ba2d046..c22f30535c84 100644
--- a/include/drm/ttm/ttm_device.h
+++ b/include/drm/ttm/ttm_device.h
@@ -223,7 +223,7 @@ struct ttm_device {
* @funcs: Function table for the device.
* Constant after bo device init
*/
- struct ttm_device_funcs *funcs;
+ const struct ttm_device_funcs *funcs;
/**
* @sysman: Resource manager for the system domain.
@@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type,
bdev->man_drv[type] = manager;
}
-int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
+int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
struct device *dev, struct address_space *mapping,
struct drm_vma_offset_manager *vma_manager,
bool use_dma_alloc, bool use_dma32);
--
2.39.1
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
2023-03-09 12:37 [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata Jani Nikula
@ 2023-03-09 12:45 ` Christian König
2023-03-09 12:49 ` Jani Nikula
2023-05-16 16:08 ` Thomas Zimmermann
1 sibling, 1 reply; 7+ messages in thread
From: Christian König @ 2023-03-09 12:45 UTC (permalink / raw)
To: Jani Nikula, dri-devel; +Cc: intel-gfx, Huang Rui
Am 09.03.23 um 13:37 schrieb Jani Nikula:
> Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
>
> Cc: Christian Koenig <christian.koenig@amd.com>
> Cc: Huang Rui <ray.huang@amd.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Good idea, Reviewed-by: Christian König <christian.koenig@amd.com>
Should I push it to drm-misc-next or do you need it on some other branch?
Christian.
> ---
> drivers/gpu/drm/ttm/ttm_device.c | 2 +-
> include/drm/ttm/ttm_device.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> index ae2f19dc9f81..a71bb1362de4 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -190,7 +190,7 @@ EXPORT_SYMBOL(ttm_device_swapout);
> * Returns:
> * !0: Failure.
> */
> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
> struct device *dev, struct address_space *mapping,
> struct drm_vma_offset_manager *vma_manager,
> bool use_dma_alloc, bool use_dma32)
> diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
> index 56e82ba2d046..c22f30535c84 100644
> --- a/include/drm/ttm/ttm_device.h
> +++ b/include/drm/ttm/ttm_device.h
> @@ -223,7 +223,7 @@ struct ttm_device {
> * @funcs: Function table for the device.
> * Constant after bo device init
> */
> - struct ttm_device_funcs *funcs;
> + const struct ttm_device_funcs *funcs;
>
> /**
> * @sysman: Resource manager for the system domain.
> @@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type,
> bdev->man_drv[type] = manager;
> }
>
> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
> struct device *dev, struct address_space *mapping,
> struct drm_vma_offset_manager *vma_manager,
> bool use_dma_alloc, bool use_dma32);
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
2023-03-09 12:45 ` Christian König
@ 2023-03-09 12:49 ` Jani Nikula
2023-05-16 8:05 ` Jani Nikula
0 siblings, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2023-03-09 12:49 UTC (permalink / raw)
To: Christian König, dri-devel; +Cc: intel-gfx, Huang Rui
On Thu, 09 Mar 2023, Christian König <christian.koenig@amd.com> wrote:
> Am 09.03.23 um 13:37 schrieb Jani Nikula:
>> Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
>>
>> Cc: Christian Koenig <christian.koenig@amd.com>
>> Cc: Huang Rui <ray.huang@amd.com>
>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> Good idea, Reviewed-by: Christian König <christian.koenig@amd.com>
Thanks!
> Should I push it to drm-misc-next or do you need it on some other branch?
Go ahead, I'm not urgently depending on it.
BR,
Jani.
>
> Christian.
>
>> ---
>> drivers/gpu/drm/ttm/ttm_device.c | 2 +-
>> include/drm/ttm/ttm_device.h | 4 ++--
>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
>> index ae2f19dc9f81..a71bb1362de4 100644
>> --- a/drivers/gpu/drm/ttm/ttm_device.c
>> +++ b/drivers/gpu/drm/ttm/ttm_device.c
>> @@ -190,7 +190,7 @@ EXPORT_SYMBOL(ttm_device_swapout);
>> * Returns:
>> * !0: Failure.
>> */
>> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
>> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
>> struct device *dev, struct address_space *mapping,
>> struct drm_vma_offset_manager *vma_manager,
>> bool use_dma_alloc, bool use_dma32)
>> diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
>> index 56e82ba2d046..c22f30535c84 100644
>> --- a/include/drm/ttm/ttm_device.h
>> +++ b/include/drm/ttm/ttm_device.h
>> @@ -223,7 +223,7 @@ struct ttm_device {
>> * @funcs: Function table for the device.
>> * Constant after bo device init
>> */
>> - struct ttm_device_funcs *funcs;
>> + const struct ttm_device_funcs *funcs;
>>
>> /**
>> * @sysman: Resource manager for the system domain.
>> @@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type,
>> bdev->man_drv[type] = manager;
>> }
>>
>> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
>> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
>> struct device *dev, struct address_space *mapping,
>> struct drm_vma_offset_manager *vma_manager,
>> bool use_dma_alloc, bool use_dma32);
>
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
2023-03-09 12:49 ` Jani Nikula
@ 2023-05-16 8:05 ` Jani Nikula
2023-05-16 16:11 ` Alex Deucher
0 siblings, 1 reply; 7+ messages in thread
From: Jani Nikula @ 2023-05-16 8:05 UTC (permalink / raw)
To: Christian König, dri-devel; +Cc: intel-gfx, Huang Rui
On Thu, 09 Mar 2023, Jani Nikula <jani.nikula@intel.com> wrote:
> On Thu, 09 Mar 2023, Christian König <christian.koenig@amd.com> wrote:
>> Am 09.03.23 um 13:37 schrieb Jani Nikula:
>>> Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
>>>
>>> Cc: Christian Koenig <christian.koenig@amd.com>
>>> Cc: Huang Rui <ray.huang@amd.com>
>>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>
>> Good idea, Reviewed-by: Christian König <christian.koenig@amd.com>
>
> Thanks!
>
>> Should I push it to drm-misc-next or do you need it on some other branch?
>
> Go ahead, I'm not urgently depending on it.
Christian, I guess this fell between the cracks? Can I just push it to
drm-misc-next?
BR,
Jani.
>
> BR,
> Jani.
>
>>
>> Christian.
>>
>>> ---
>>> drivers/gpu/drm/ttm/ttm_device.c | 2 +-
>>> include/drm/ttm/ttm_device.h | 4 ++--
>>> 2 files changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
>>> index ae2f19dc9f81..a71bb1362de4 100644
>>> --- a/drivers/gpu/drm/ttm/ttm_device.c
>>> +++ b/drivers/gpu/drm/ttm/ttm_device.c
>>> @@ -190,7 +190,7 @@ EXPORT_SYMBOL(ttm_device_swapout);
>>> * Returns:
>>> * !0: Failure.
>>> */
>>> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
>>> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
>>> struct device *dev, struct address_space *mapping,
>>> struct drm_vma_offset_manager *vma_manager,
>>> bool use_dma_alloc, bool use_dma32)
>>> diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
>>> index 56e82ba2d046..c22f30535c84 100644
>>> --- a/include/drm/ttm/ttm_device.h
>>> +++ b/include/drm/ttm/ttm_device.h
>>> @@ -223,7 +223,7 @@ struct ttm_device {
>>> * @funcs: Function table for the device.
>>> * Constant after bo device init
>>> */
>>> - struct ttm_device_funcs *funcs;
>>> + const struct ttm_device_funcs *funcs;
>>>
>>> /**
>>> * @sysman: Resource manager for the system domain.
>>> @@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type,
>>> bdev->man_drv[type] = manager;
>>> }
>>>
>>> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
>>> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
>>> struct device *dev, struct address_space *mapping,
>>> struct drm_vma_offset_manager *vma_manager,
>>> bool use_dma_alloc, bool use_dma32);
>>
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
2023-05-16 8:05 ` Jani Nikula
@ 2023-05-16 16:11 ` Alex Deucher
2023-05-17 9:26 ` Jani Nikula
0 siblings, 1 reply; 7+ messages in thread
From: Alex Deucher @ 2023-05-16 16:11 UTC (permalink / raw)
To: Jani Nikula; +Cc: intel-gfx, Huang Rui, Christian König, dri-devel
On Tue, May 16, 2023 at 4:05 AM Jani Nikula <jani.nikula@intel.com> wrote:
>
> On Thu, 09 Mar 2023, Jani Nikula <jani.nikula@intel.com> wrote:
> > On Thu, 09 Mar 2023, Christian König <christian.koenig@amd.com> wrote:
> >> Am 09.03.23 um 13:37 schrieb Jani Nikula:
> >>> Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
> >>>
> >>> Cc: Christian Koenig <christian.koenig@amd.com>
> >>> Cc: Huang Rui <ray.huang@amd.com>
> >>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
> >>
> >> Good idea, Reviewed-by: Christian König <christian.koenig@amd.com>
> >
> > Thanks!
> >
> >> Should I push it to drm-misc-next or do you need it on some other branch?
> >
> > Go ahead, I'm not urgently depending on it.
>
> Christian, I guess this fell between the cracks? Can I just push it to
> drm-misc-next?
Go ahead. Christian is out of the office this week.
Alex
>
> BR,
> Jani.
>
>
> >
> > BR,
> > Jani.
> >
> >>
> >> Christian.
> >>
> >>> ---
> >>> drivers/gpu/drm/ttm/ttm_device.c | 2 +-
> >>> include/drm/ttm/ttm_device.h | 4 ++--
> >>> 2 files changed, 3 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> >>> index ae2f19dc9f81..a71bb1362de4 100644
> >>> --- a/drivers/gpu/drm/ttm/ttm_device.c
> >>> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> >>> @@ -190,7 +190,7 @@ EXPORT_SYMBOL(ttm_device_swapout);
> >>> * Returns:
> >>> * !0: Failure.
> >>> */
> >>> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
> >>> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
> >>> struct device *dev, struct address_space *mapping,
> >>> struct drm_vma_offset_manager *vma_manager,
> >>> bool use_dma_alloc, bool use_dma32)
> >>> diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
> >>> index 56e82ba2d046..c22f30535c84 100644
> >>> --- a/include/drm/ttm/ttm_device.h
> >>> +++ b/include/drm/ttm/ttm_device.h
> >>> @@ -223,7 +223,7 @@ struct ttm_device {
> >>> * @funcs: Function table for the device.
> >>> * Constant after bo device init
> >>> */
> >>> - struct ttm_device_funcs *funcs;
> >>> + const struct ttm_device_funcs *funcs;
> >>>
> >>> /**
> >>> * @sysman: Resource manager for the system domain.
> >>> @@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type,
> >>> bdev->man_drv[type] = manager;
> >>> }
> >>>
> >>> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
> >>> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
> >>> struct device *dev, struct address_space *mapping,
> >>> struct drm_vma_offset_manager *vma_manager,
> >>> bool use_dma_alloc, bool use_dma32);
> >>
>
> --
> Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
2023-05-16 16:11 ` Alex Deucher
@ 2023-05-17 9:26 ` Jani Nikula
0 siblings, 0 replies; 7+ messages in thread
From: Jani Nikula @ 2023-05-17 9:26 UTC (permalink / raw)
To: Alex Deucher; +Cc: intel-gfx, Huang Rui, Christian König, dri-devel
On Tue, 16 May 2023, Alex Deucher <alexdeucher@gmail.com> wrote:
> On Tue, May 16, 2023 at 4:05 AM Jani Nikula <jani.nikula@intel.com> wrote:
>>
>> On Thu, 09 Mar 2023, Jani Nikula <jani.nikula@intel.com> wrote:
>> > On Thu, 09 Mar 2023, Christian König <christian.koenig@amd.com> wrote:
>> >> Am 09.03.23 um 13:37 schrieb Jani Nikula:
>> >>> Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
>> >>>
>> >>> Cc: Christian Koenig <christian.koenig@amd.com>
>> >>> Cc: Huang Rui <ray.huang@amd.com>
>> >>> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>> >>
>> >> Good idea, Reviewed-by: Christian König <christian.koenig@amd.com>
>> >
>> > Thanks!
>> >
>> >> Should I push it to drm-misc-next or do you need it on some other branch?
>> >
>> > Go ahead, I'm not urgently depending on it.
>>
>> Christian, I guess this fell between the cracks? Can I just push it to
>> drm-misc-next?
>
> Go ahead. Christian is out of the office this week.
Thanks, pushed to drm-misc-next.
BR,
Jani.
--
Jani Nikula, Intel Open Source Graphics Center
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata
2023-03-09 12:37 [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata Jani Nikula
2023-03-09 12:45 ` Christian König
@ 2023-05-16 16:08 ` Thomas Zimmermann
1 sibling, 0 replies; 7+ messages in thread
From: Thomas Zimmermann @ 2023-05-16 16:08 UTC (permalink / raw)
To: Jani Nikula, dri-devel; +Cc: intel-gfx, Huang Rui, Christian Koenig
[-- Attachment #1.1: Type: text/plain, Size: 2342 bytes --]
Am 09.03.23 um 13:37 schrieb Jani Nikula:
> Make the struct ttm_device_funcs pointers const so the data can be placed in rodata.
>
> Cc: Christian Koenig <christian.koenig@amd.com>
> Cc: Huang Rui <ray.huang@amd.com>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
> ---
> drivers/gpu/drm/ttm/ttm_device.c | 2 +-
> include/drm/ttm/ttm_device.h | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/ttm/ttm_device.c b/drivers/gpu/drm/ttm/ttm_device.c
> index ae2f19dc9f81..a71bb1362de4 100644
> --- a/drivers/gpu/drm/ttm/ttm_device.c
> +++ b/drivers/gpu/drm/ttm/ttm_device.c
> @@ -190,7 +190,7 @@ EXPORT_SYMBOL(ttm_device_swapout);
> * Returns:
> * !0: Failure.
> */
> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
> struct device *dev, struct address_space *mapping,
> struct drm_vma_offset_manager *vma_manager,
> bool use_dma_alloc, bool use_dma32)
> diff --git a/include/drm/ttm/ttm_device.h b/include/drm/ttm/ttm_device.h
> index 56e82ba2d046..c22f30535c84 100644
> --- a/include/drm/ttm/ttm_device.h
> +++ b/include/drm/ttm/ttm_device.h
> @@ -223,7 +223,7 @@ struct ttm_device {
> * @funcs: Function table for the device.
> * Constant after bo device init
> */
> - struct ttm_device_funcs *funcs;
> + const struct ttm_device_funcs *funcs;
>
> /**
> * @sysman: Resource manager for the system domain.
> @@ -287,7 +287,7 @@ static inline void ttm_set_driver_manager(struct ttm_device *bdev, int type,
> bdev->man_drv[type] = manager;
> }
>
> -int ttm_device_init(struct ttm_device *bdev, struct ttm_device_funcs *funcs,
> +int ttm_device_init(struct ttm_device *bdev, const struct ttm_device_funcs *funcs,
> struct device *dev, struct address_space *mapping,
> struct drm_vma_offset_manager *vma_manager,
> bool use_dma_alloc, bool use_dma32);
--
Thomas Zimmermann
Graphics Driver Developer
SUSE Software Solutions Germany GmbH
Frankenstrasse 146, 90461 Nuernberg, Germany
GF: Ivo Totev, Andrew Myers, Andrew McDonald, Boudien Moerman
HRB 36809 (AG Nuernberg)
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 840 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2023-05-17 9:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-09 12:37 [PATCH] drm/ttm: let struct ttm_device_funcs be placed in rodata Jani Nikula
2023-03-09 12:45 ` Christian König
2023-03-09 12:49 ` Jani Nikula
2023-05-16 8:05 ` Jani Nikula
2023-05-16 16:11 ` Alex Deucher
2023-05-17 9:26 ` Jani Nikula
2023-05-16 16:08 ` Thomas Zimmermann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox