From: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
To: "Kalamarz, Lukasz" <lukasz.kalamarz@intel.com>,
"igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>
Subject: Re: [igt-dev] [PATCH i-g-t v3 1/4] lib/ioctl_wrapper: use defines for get_param instead of param number
Date: Mon, 14 Jan 2019 10:05:39 -0800 [thread overview]
Message-ID: <b3ffd1a4-768d-aa0b-b668-49be42c20a12@intel.com> (raw)
In-Reply-To: <4b44e8164060e99e7d67c8a5727d23ae659b06a6.camel@intel.com>
On 01/14/2019 07:55 AM, Kalamarz, Lukasz wrote:
> On Fri, 2019-01-11 at 09:54 -0800, Daniele Ceraolo Spurio wrote:
>>
>> On 01/11/2019 08:15 AM, Lukasz Kalamarz wrote:
>>> In lib code there were few functions using param number instead of
>>> defines. This could lead to some issues (i.e. stolen support
>>> pointing on different parameter) and we would like to avoid them.
>>
>> The 3 defines you're touching are part of the published kernel uapi,
>> so
>> there is no way for them to change and cause issues. The change is
>
>
> In theory what You've said is true, but we had one example within IGT
> that may be causing troubles. We had gem_stolen issue, where we are
> pointing to param with direct number (38), but then uapi is pointing on
> something different (changes in i915 for stole support were never
> merged). When running those tests (only hibernate testcase is not run
> in during fullrun executions) we may be touching something different
> than we expect.
>
My comment was regarding exclusively the flags touched by this patch.
The test in your example was merged to IGT before the flag was merged in
the kernel, which meant the latter was still not part of the uapi and
thus could still change.
Daniele
>> still
>> worth doing IMO since defines are better than hard-coded numbers.
>>
>>> v2: Rebased patch
>>>
>>> Signed-off-by: Lukasz Kalamarz <lukasz.kalamarz@intel.com>
>>> Cc: Michal Winiarski <michal.winiarski@intel.com>
>>> Cc: Katarzyna Dec <katarzyna.dec@intel.com>
>>> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>> Cc: Chris Wilson <chris@chris-wilson.co.uk>
>>
>> All 3 defs are in the i915_drm.h file in IGT, so with a cleaned
>> commit
>> message:
>>
>> Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
>>
>>> ---
>>> lib/ioctl_wrappers.c | 6 +++---
>>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
>>> index 9f255508..f71f0e32 100644
>>> --- a/lib/ioctl_wrappers.c
>>> +++ b/lib/ioctl_wrappers.c
>>> @@ -708,12 +708,12 @@ bool gem_mmap__has_wc(int fd)
>>> has_wc = 0;
>>>
>>> memset(&gp, 0, sizeof(gp));
>>> - gp.param = 40; /* MMAP_GTT_VERSION */
>>> + gp.param = I915_PARAM_MMAP_GTT_VERSION;
>>> gp.value = >t_version;
>>> ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
>>>
>>> memset(&gp, 0, sizeof(gp));
>>> - gp.param = 30; /* MMAP_VERSION */
>>> + gp.param = I915_PARAM_MMAP_VERSION;
>>> gp.value = &mmap_version;
>>> ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp);
>>>
>>> @@ -964,7 +964,7 @@ static int gem_gtt_type(int fd)
>>> int val = 0;
>>>
>>> memset(&gp, 0, sizeof(gp));
>>> - gp.param = 18; /* HAS_ALIASING_PPGTT */
>>> + gp.param = I915_PARAM_HAS_ALIASING_PPGTT;
>>> gp.value = &val;
>>>
>>> if (ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp)))
>>>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-01-14 18:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-11 16:15 [igt-dev] [PATCH i-g-t v3 1/4] lib/ioctl_wrapper: use defines for get_param instead of param number Lukasz Kalamarz
2019-01-11 16:15 ` [igt-dev] [PATCH i-g-t v3 2/4] lib/igt_dummyload: use gem_mmap__cpu and gem_mmap__wc when applicable Lukasz Kalamarz
2019-01-11 17:26 ` Daniele Ceraolo Spurio
2019-01-11 16:15 ` [igt-dev] [PATCH i-g-t v3 3/4] lib/ioctl_wrapper: Implement __gem_mmap Lukasz Kalamarz
2019-01-11 17:39 ` Daniele Ceraolo Spurio
2019-01-14 15:58 ` Kalamarz, Lukasz
2019-01-11 16:15 ` [igt-dev] [PATCH i-g-t v3 4/4] lib/ioctl_wrapper: Use __gem_mmap within __gem_mmap__cpu/wc Lukasz Kalamarz
2019-01-11 16:41 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v3,1/4] lib/ioctl_wrapper: use defines for get_param instead of param number Patchwork
2019-01-11 17:54 ` [igt-dev] [PATCH i-g-t v3 1/4] " Daniele Ceraolo Spurio
2019-01-14 15:55 ` Kalamarz, Lukasz
2019-01-14 18:05 ` Daniele Ceraolo Spurio [this message]
2019-01-11 21:43 ` [igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v3,1/4] " Patchwork
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=b3ffd1a4-768d-aa0b-b668-49be42c20a12@intel.com \
--to=daniele.ceraolospurio@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=lukasz.kalamarz@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox