<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">On 3/5/20 7:42 PM, Luben Tuikov wrote:<br>
    </div>
    <blockquote type="cite" cite="mid:96eb728e-e44a-0d95-0303-f24ec8620df2@amd.com"><br>
      <blockquote type="cite">
        <pre class="moz-quote-pre" wrap="">
A quick search leads me amdgpu_sched_ioctl() which is using 
DRM_SCHED_PRIORITY_INVALID

to indicate a invalid value from userspace. I don't know much about drm 
api to suggest any useful

changes regarding this. But again this isn't in the scope of this patch 
series.
</pre>
      </blockquote>
      <pre class="moz-quote-pre" wrap="">
I'm not asking you to eliminate "DRM_SCHED_PRIORITY_INVALID".
Oh wait! You forgot what I suggested in a previous review on
how to fix enum drm_sched_priority, did you? :-D Search
for that email.</pre>
    </blockquote>
    <p>Let me quote[1]: <br>
    </p>
    <p>"<br>
    </p>
    <p>Also consider changing to this:</p>
    <br>
    enum drm_sched_priority {<br>
            DRM_SCHED_PRIORITY_UNSET,<br>
    --------DRM_SCHED_PRIORITY_INVALID,--------<--- remove<br>
            DRM_SCHED_PRIORITY_MIN,<br>
            DRM_SCHED_PRIORITY_LOW = DRM_SCHED_PRIORITY_MIN,<br>
            DRM_SCHED_PRIORITY_NORMAL,<br>
            DRM_SCHED_PRIORITY_HIGH_SW,<br>
            DRM_SCHED_PRIORITY_HIGH_HW,<br>
            DRM_SCHED_PRIORITY_KERNEL,<br>
            DRM_SCHED_PRIORITY_MAX,<br>
    };<br>
    <br>
    We should never have an "invalid priority", just ignored priority.
    :-)<br>
    Second, having 0 as UNSET gives you easy priority when you set<br>
    map[0] = normal_priority, as memory usually comes memset to 0.<br>
    IOW, you'd not need to check against UNSET, and simply use<br>
    the default [0] which you'd set to normal priority.<br>
    <p>"<br>
    </p>
    <p>I guess understood it wrong.</p>
    <p><br>
    </p>
    <p><a href="https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg45621.html">[1]https://www.mail-archive.com/amd-gfx@lists.freedesktop.org/msg45621.html</a></p>
    <p><br>
    </p>
    <p>Regards,</p>
    <p>Nirmoy<br>
    </p>
  </body>
</html>