diff mbox series

[v2,3/7] drm/ttm: Use the BIT macro for the TTM_TT_FLAGs

Message ID 20230307144621.10748-4-thomas.hellstrom@linux.intel.com (mailing list archive)
State New, archived
Headers show
Series drm/ttm: Small fixes / cleanups in prep for shrinking | expand

Commit Message

Thomas Hellström March 7, 2023, 2:46 p.m. UTC
New code is recommended to use the BIT macro instead of the explicit
shifts. Change the older defines so that we can keep the style consistent
with upcoming changes.

v2:
- Also change the value of the _PRIV_POPULATED bit (Christian König)

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
---
 include/drm/ttm/ttm_tt.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Christian König March 8, 2023, 8:49 a.m. UTC | #1
Am 07.03.23 um 15:46 schrieb Thomas Hellström:
> New code is recommended to use the BIT macro instead of the explicit
> shifts. Change the older defines so that we can keep the style consistent
> with upcoming changes.
>
> v2:
> - Also change the value of the _PRIV_POPULATED bit (Christian König)
>
> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
>   include/drm/ttm/ttm_tt.h | 10 +++++-----
>   1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
> index b7d3f3843f1e..977ca195a536 100644
> --- a/include/drm/ttm/ttm_tt.h
> +++ b/include/drm/ttm/ttm_tt.h
> @@ -83,12 +83,12 @@ struct ttm_tt {
>   	 * set by TTM after ttm_tt_populate() has successfully returned, and is
>   	 * then unset when TTM calls ttm_tt_unpopulate().
>   	 */
> -#define TTM_TT_FLAG_SWAPPED		(1 << 0)
> -#define TTM_TT_FLAG_ZERO_ALLOC		(1 << 1)
> -#define TTM_TT_FLAG_EXTERNAL		(1 << 2)
> -#define TTM_TT_FLAG_EXTERNAL_MAPPABLE	(1 << 3)
> +#define TTM_TT_FLAG_SWAPPED		BIT(0)
> +#define TTM_TT_FLAG_ZERO_ALLOC		BIT(1)
> +#define TTM_TT_FLAG_EXTERNAL		BIT(2)
> +#define TTM_TT_FLAG_EXTERNAL_MAPPABLE	BIT(3)
>   
> -#define TTM_TT_FLAG_PRIV_POPULATED  (1U << 31)
> +#define TTM_TT_FLAG_PRIV_POPULATED	BIT(4)
>   	uint32_t page_flags;
>   	/** @num_pages: Number of pages in the page array. */
>   	uint32_t num_pages;
Thomas Hellström March 9, 2023, 7:06 a.m. UTC | #2
Hi, Christian,

Thanks for reviewing these.

Ack to merge reviewed patches through drm-misc-next?

Thanks,

Thomas


On 3/8/23 09:49, Christian König wrote:
> Am 07.03.23 um 15:46 schrieb Thomas Hellström:
>> New code is recommended to use the BIT macro instead of the explicit
>> shifts. Change the older defines so that we can keep the style 
>> consistent
>> with upcoming changes.
>>
>> v2:
>> - Also change the value of the _PRIV_POPULATED bit (Christian König)
>>
>> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>
> Reviewed-by: Christian König <christian.koenig@amd.com>
>
>> ---
>>   include/drm/ttm/ttm_tt.h | 10 +++++-----
>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
>> index b7d3f3843f1e..977ca195a536 100644
>> --- a/include/drm/ttm/ttm_tt.h
>> +++ b/include/drm/ttm/ttm_tt.h
>> @@ -83,12 +83,12 @@ struct ttm_tt {
>>        * set by TTM after ttm_tt_populate() has successfully 
>> returned, and is
>>        * then unset when TTM calls ttm_tt_unpopulate().
>>        */
>> -#define TTM_TT_FLAG_SWAPPED        (1 << 0)
>> -#define TTM_TT_FLAG_ZERO_ALLOC        (1 << 1)
>> -#define TTM_TT_FLAG_EXTERNAL        (1 << 2)
>> -#define TTM_TT_FLAG_EXTERNAL_MAPPABLE    (1 << 3)
>> +#define TTM_TT_FLAG_SWAPPED        BIT(0)
>> +#define TTM_TT_FLAG_ZERO_ALLOC        BIT(1)
>> +#define TTM_TT_FLAG_EXTERNAL        BIT(2)
>> +#define TTM_TT_FLAG_EXTERNAL_MAPPABLE    BIT(3)
>>   -#define TTM_TT_FLAG_PRIV_POPULATED  (1U << 31)
>> +#define TTM_TT_FLAG_PRIV_POPULATED    BIT(4)
>>       uint32_t page_flags;
>>       /** @num_pages: Number of pages in the page array. */
>>       uint32_t num_pages;
>
Christian König March 9, 2023, 8:06 a.m. UTC | #3
Am 09.03.23 um 08:06 schrieb Thomas Hellström:
> Hi, Christian,
>
> Thanks for reviewing these.
>
> Ack to merge reviewed patches through drm-misc-next?

Sure.

Christian.

>
> Thanks,
>
> Thomas
>
>
> On 3/8/23 09:49, Christian König wrote:
>> Am 07.03.23 um 15:46 schrieb Thomas Hellström:
>>> New code is recommended to use the BIT macro instead of the explicit
>>> shifts. Change the older defines so that we can keep the style 
>>> consistent
>>> with upcoming changes.
>>>
>>> v2:
>>> - Also change the value of the _PRIV_POPULATED bit (Christian König)
>>>
>>> Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
>>
>> Reviewed-by: Christian König <christian.koenig@amd.com>
>>
>>> ---
>>>   include/drm/ttm/ttm_tt.h | 10 +++++-----
>>>   1 file changed, 5 insertions(+), 5 deletions(-)
>>>
>>> diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
>>> index b7d3f3843f1e..977ca195a536 100644
>>> --- a/include/drm/ttm/ttm_tt.h
>>> +++ b/include/drm/ttm/ttm_tt.h
>>> @@ -83,12 +83,12 @@ struct ttm_tt {
>>>        * set by TTM after ttm_tt_populate() has successfully 
>>> returned, and is
>>>        * then unset when TTM calls ttm_tt_unpopulate().
>>>        */
>>> -#define TTM_TT_FLAG_SWAPPED        (1 << 0)
>>> -#define TTM_TT_FLAG_ZERO_ALLOC        (1 << 1)
>>> -#define TTM_TT_FLAG_EXTERNAL        (1 << 2)
>>> -#define TTM_TT_FLAG_EXTERNAL_MAPPABLE    (1 << 3)
>>> +#define TTM_TT_FLAG_SWAPPED        BIT(0)
>>> +#define TTM_TT_FLAG_ZERO_ALLOC        BIT(1)
>>> +#define TTM_TT_FLAG_EXTERNAL        BIT(2)
>>> +#define TTM_TT_FLAG_EXTERNAL_MAPPABLE    BIT(3)
>>>   -#define TTM_TT_FLAG_PRIV_POPULATED  (1U << 31)
>>> +#define TTM_TT_FLAG_PRIV_POPULATED    BIT(4)
>>>       uint32_t page_flags;
>>>       /** @num_pages: Number of pages in the page array. */
>>>       uint32_t num_pages;
>>
diff mbox series

Patch

diff --git a/include/drm/ttm/ttm_tt.h b/include/drm/ttm/ttm_tt.h
index b7d3f3843f1e..977ca195a536 100644
--- a/include/drm/ttm/ttm_tt.h
+++ b/include/drm/ttm/ttm_tt.h
@@ -83,12 +83,12 @@  struct ttm_tt {
 	 * set by TTM after ttm_tt_populate() has successfully returned, and is
 	 * then unset when TTM calls ttm_tt_unpopulate().
 	 */
-#define TTM_TT_FLAG_SWAPPED		(1 << 0)
-#define TTM_TT_FLAG_ZERO_ALLOC		(1 << 1)
-#define TTM_TT_FLAG_EXTERNAL		(1 << 2)
-#define TTM_TT_FLAG_EXTERNAL_MAPPABLE	(1 << 3)
+#define TTM_TT_FLAG_SWAPPED		BIT(0)
+#define TTM_TT_FLAG_ZERO_ALLOC		BIT(1)
+#define TTM_TT_FLAG_EXTERNAL		BIT(2)
+#define TTM_TT_FLAG_EXTERNAL_MAPPABLE	BIT(3)
 
-#define TTM_TT_FLAG_PRIV_POPULATED  (1U << 31)
+#define TTM_TT_FLAG_PRIV_POPULATED	BIT(4)
 	uint32_t page_flags;
 	/** @num_pages: Number of pages in the page array. */
 	uint32_t num_pages;