From: Luben Tuikov <luben.tuikov@amd.com>
To: Nirmoy <nirmodas@amd.com>, amd-gfx@lists.freedesktop.org
Cc: alexander.deucher@amd.com, kenny.ho@amd.com, nirmoy.das@amd.com,
christian.koenig@amd.com
Subject: Re: [PATCH 2/2] drm/amdgpu: allocate entities on demand
Date: Wed, 22 Jan 2020 10:51:51 -0500 [thread overview]
Message-ID: <406c7e5c-6e43-23ce-2be7-b39968c98da2@amd.com> (raw)
In-Reply-To: <d3a300b7-1516-b332-0e60-6acb36100a29@amd.com>
On 2020-01-22 4:25 a.m., Nirmoy wrote:
> Hi Luben,
>
> Thanks for reviewing. Was expecting lot from vim auto-indent :/
Yes, no problem. It's a learning experience for me as well.
If you use Emacs, pressing TAB anywhere on a line, will indent
it according to the mode. (It runs the (c-indent-line-or-region)
Lisp function, when the major mode is "C".) Pressing TAB anywhere
in a line which has already been indented according to mode, does
nothing.
You can also indent the whole file (region) by pressing C-M-\.
>
> On 1/22/20 1:07 AM, Luben Tuikov wrote:
>> On 2020-01-21 11:50 a.m., Nirmoy Das wrote:
>>
>>> - switch (i) {
>>> + priority = (ctx->override_priority == DRM_SCHED_PRIORITY_UNSET) ?
>>> + ctx->init_priority : ctx->override_priority;
>> You don't need parenthesis around the relational equality operator used here.
>> It has higher precedence than the ternary conditional, in which it is embedded.
>
> Parenthesis makes it more human readable.
>
>
>>> + int r;
>>> +
>>> + if (priority < 0 || priority >= DRM_SCHED_PRIORITY_MAX)
>>> + return -EINVAL;
>> This shouldn't be possible since it is an enum...
> What should not be possible ?
>> But why not do this check in "amdgpu_ctx_priority_permit()"
>> which is introduced by this patchset and used in the imediately
>> following line?
> Makes sense.
>>
>> Or perhaps fix up amdgpu_to_sched_priority() where it is massaged
>> from the ioctl argument which is an integer.
>>
>> On a side note: I noticed that the enum drm_sched_priority
>> has no DRM_SCHED_PRIORITY_NONE.
>>
>> I've found value in setting the first value of an enum to
>> "_NONE" (unless zero actually has a meaning as set by HW/etc., anyway).
>> Enum drm_sched_priority starts with "_MIN" and "_LOW" which
>> are both set to the same (zero) value.
>>
>> So having DRM_SCHED_PRIORITY_NONE, could be used to denote
>> that no priority was given and any is fine, or to mean
>> that if the priority was given out of range, set it to "none",
>> to mean pick any.
>
> Not sure about if HW accepts 0.
Exactly! We use "0" to mean, as I described above,
"that no priority was given and any is fine, or to mean
that if the priority given [by the user] is out of range,
set it to ``none'' to mean pick any", that is so that
we actually input to hardware a meaningful value.
It's just a conveyance.
Using/adding "_NONE" in enums (as usually the first enumerated literal (0))
really changes algorithms, as it makes representing concepts easier.
(Kind of like when we said, let i = sqrt(-1).)
Regards,
Luben
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
next prev parent reply other threads:[~2020-01-22 15:51 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-21 16:50 [PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP Nirmoy Das
2020-01-21 16:50 ` [PATCH 2/2] drm/amdgpu: allocate entities on demand Nirmoy Das
2020-01-22 0:07 ` Luben Tuikov
2020-01-22 9:25 ` Nirmoy
2020-01-22 15:51 ` Luben Tuikov [this message]
2020-01-21 23:34 ` [PATCH 1/2] drm/amdgpu: individualize amdgpu entity allocation per HW IP Luben Tuikov
2020-01-22 9:32 ` Nirmoy
2020-01-22 16:24 ` Luben Tuikov
-- strict thread matches above, loose matches on Subject: below --
2020-01-22 9:33 Nirmoy Das
2020-01-22 9:33 ` [PATCH 2/2] drm/amdgpu: allocate entities on demand Nirmoy Das
2020-01-22 11:39 ` Christian König
2020-01-22 12:03 ` Nirmoy
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=406c7e5c-6e43-23ce-2be7-b39968c98da2@amd.com \
--to=luben.tuikov@amd.com \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=christian.koenig@amd.com \
--cc=kenny.ho@amd.com \
--cc=nirmodas@amd.com \
--cc=nirmoy.das@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox