~proton1980/ubuntu/+source/linux/+git/mirror-drm-intel:topic/intel-gen-to-ver

Last commit made on 2021-04-14
Get this branch:
git clone -b topic/intel-gen-to-ver https://git.launchpad.net/~proton1980/ubuntu/+source/linux/+git/mirror-drm-intel
Only Ghz can upload to this branch. If you are Ghz please log in for upload directions.

Branch merges

Branch information

Name:
topic/intel-gen-to-ver
Repository:
lp:~proton1980/ubuntu/+source/linux/+git/mirror-drm-intel

Recent commits

425390c... by Lucas De Marchi

drm/i915: split dgfx features from gen 12

Make them independent so we can use DGFX_FEATURES more generically.
For future platforms that do not use the GEN nomenclature we will define
graphics, media and display separately, so we avoid setting graphics_ver
with the GEN() macro.

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

1ab52b4... by Lucas De Marchi

drm/i915: add media and display versions to device_info print

Since we are now converting from a single gen version to graphics_ver,
media_ver and display_ver, add the last 2 when printing the device info.

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

7b36b7d... by Lucas De Marchi

drm/i915: finish removal of gen from intel_device_info

Now that it's not being used anymore, finish its removal. Like for
gen_mask, we replace INTEL_GEN() and IS_GEN() macros to use the new
field.

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
[Jani: Minor code comment change while applying.]
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

8802190... by Lucas De Marchi

drm/i915: eliminate remaining uses of intel_device_info->gen

Replace gen with the new graphics_ver value and use GRAPHICS_VER()
in those places.

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

58e0d8a... by Lucas De Marchi

drm/i915: finish removal of gen_mask

Now that it's not used anywhere, remove it from struct
intel_device_info. To allow a period in which code will be converted to
the new macro, keep IS_GEN_RANGE() around, just redefining it to use
the new fields. The size advantage from IS_GEN_RANGE() using a mask is
not that big as it has pretty limited use througout the driver:

   text data bss dec hex filename
2758497 95965 6496 2860958 2ba79e drivers/gpu/drm/i915/i915.ko.old
2758586 95953 6496 2861035 2ba7eb drivers/gpu/drm/i915/i915.ko.new

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
[Jani: Minor code comment change while applying.]
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

33adf48... by Lucas De Marchi

drm/i915/selftests: eliminate use of gen_mask

Remove the remaining uses of INTEL_GEN_MASK() and the correspondent
gen_mask in struct intel_device_info. This will allow the removal of
gen_mask later since it's incompatible with the new per-IP versioning
scheme.

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

3e6e4c2... by Lucas De Marchi

drm/i915/selftests: replace unused mask with simple version

Since its introduction 2 years ago, we never used the mask to span more
than one gen. Replace gen_mask a single number and start using the new
GRAPHICS_VER().

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

1b9d840... by Lucas De Marchi

drm/i915/gt: replace gen use in intel_engine_cs

Start using the new fields graphics_version for the previous gen checks.
Here we rename the "gen" field and replace the comparisons using it to
start using the new GRAPHICS_VER(). Other uses of INTEL_GEN() were left
as is for automatic conversion later.

Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

93babb0... by Lucas De Marchi

drm/i915: add macros for graphics and media versions

Like it was done in
commit 01eb15c9165e ("drm/i915: Add DISPLAY_VER() and related macros")
add the correspondent macros for graphics and media. Going forward we
will prefer checking the versions for the specific IPs (graphics, media
and display) rather than grouping everything under a "gen" version.

For consistency and to make the maintenance easier, it'd be preferred
not to mix the *GEN* macros with the new ones. For older platforms we
can simply consider that the previous "gen" number will extend to all
3 IPs. Then we can start replacing its use in the driver. Right now this
replacement is not done and only the infrastructure is put in place.
We also leave gen and gen_mask inside struct intel_device_info while
it's still being used throughout the code.

v2: Repurpose IS_{GRAPHICS,MEDIA}_VER() macros to work with a range

Signed-off-by: Lucas De Marchi <email address hidden>
Reviewed-by: José Roberto de Souza <email address hidden>
Reviewed-by: Jani Nikula <email address hidden>
[Jani: Minor code comment change while applying.]
Signed-off-by: Jani Nikula <email address hidden>
Link: https://patchwork.freedesktop<email address hidden>

93e7e61... by Lucas De Marchi

drm/i915/display: rename display version macros

While converting the rest of the driver to use GRAPHICS_VER() and
MEDIA_VER(), following what was done for display, some discussions went
back on what we did for display:

 1) Why is the == comparison special that deserves a separate
 macro instead of just getting the version and comparing directly
 like is done for >, >=, <=?

 2) IS_DISPLAY_RANGE() is weird in that it omits the "_VER" for
 brevity. If we remove the current users of IS_DISPLAY_VER(), we
 could actually repurpose it for a range check

With (1) there could be an advantage if we used gen_mask since multiple
conditionals be combined by the compiler in a single and instruction and
check the result. However a) INTEL_GEN() doesn't use the mask since it
would make the code bigger everywhere else and b) in the cases it made
sense, it also made sense to convert to the _RANGE() variant.

So here we repurpose IS_DISPLAY_VER() to work with a [ from, to ] range
like was the IS_DISPLAY_RANGE() and convert the current IS_DISPLAY_VER()
users to use == and != operators. Aside from the definition changes,
this was done by the following semantic patch:

 @@ expression dev_priv, E1; @@
 - !IS_DISPLAY_VER(dev_priv, E1)
 + DISPLAY_VER(dev_priv) != E1

 @@ expression dev_priv, E1; @@
 - IS_DISPLAY_VER(dev_priv, E1)
 + DISPLAY_VER(dev_priv) == E1

 @@ expression dev_priv, from, until; @@
 - IS_DISPLAY_RANGE(dev_priv, from, until)
 + IS_DISPLAY_VER(dev_priv, from, until)

Cc: Jani Nikula <email address hidden>
Cc: Matt Roper <email address hidden>
Reviewed-by: Jani Nikula <email address hidden>
Signed-off-by: Lucas De Marchi <email address hidden>
[Jani: Minor conflict resolve while applying.]
Signed-off-by: Jani Nikula <email address hidden>
Link: http://patchwork.freedesktop<email address hidden>