Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/xe/rtp: Add match on any GT

One surprising factor of GRAPHICS_VERSION()/MEDIA_VERSION() matching for
people adding new WAs is that it implicitly checks that the
graphics/media IP under check is of that specific type and not that the
device contains a media/graphics IP of that version. Add a new
*_ANY_GT() variant that can be used in that case.

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Reviewed-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240618050044.324454-5-lucas.demarchi@intel.com

authored by

Lucas De Marchi and committed by
Matt Roper
c8c00286 dc72c52a

+37 -1
+6
drivers/gpu/drm/xe/xe_rtp.c
··· 63 63 xe->info.graphics_verx100 <= r->ver_end && 64 64 (!has_samedia(xe) || !xe_gt_is_media_type(gt)); 65 65 break; 66 + case XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT: 67 + match = xe->info.graphics_verx100 == r->ver_start; 68 + break; 66 69 case XE_RTP_MATCH_GRAPHICS_STEP: 67 70 match = xe->info.step.graphics >= r->step_start && 68 71 xe->info.step.graphics < r->step_end && ··· 84 81 match = xe->info.step.media >= r->step_start && 85 82 xe->info.step.media < r->step_end && 86 83 (!has_samedia(xe) || xe_gt_is_media_type(gt)); 84 + break; 85 + case XE_RTP_MATCH_MEDIA_VERSION_ANY_GT: 86 + match = xe->info.media_verx100 == r->ver_start; 87 87 break; 88 88 case XE_RTP_MATCH_INTEGRATED: 89 89 match = !xe->info.is_dgfx;
+29 -1
drivers/gpu/drm/xe/xe_rtp.h
··· 140 140 .ver_start = ver_start__, .ver_end = ver_end__, } 141 141 142 142 /** 143 - * XE_RTP_RULE_MEDIA_VERSION - Create rule matching media version 143 + * XE_RTP_RULE_GRAPHICS_VERSION_ANY_GT - Create rule matching graphics version on any GT 144 144 * @ver__: Graphics IP version to match 145 + * 146 + * Like XE_RTP_RULE_GRAPHICS_VERSION, but it matches even if the current GT 147 + * being checked is not of the graphics type. It allows to add RTP entries to 148 + * another GT when the device contains a Graphics IP with that version. 149 + * 150 + * Refer to XE_RTP_RULES() for expected usage. 151 + */ 152 + #define XE_RTP_RULE_GRAPHICS_VERSION_ANY_GT(ver__) \ 153 + { .match_type = XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT, \ 154 + .ver_start = ver__, } 155 + 156 + /** 157 + * XE_RTP_RULE_MEDIA_VERSION - Create rule matching media version 158 + * @ver__: Media IP version to match 145 159 * 146 160 * Refer to XE_RTP_RULES() for expected usage. 147 161 */ ··· 176 162 #define XE_RTP_RULE_MEDIA_VERSION_RANGE(ver_start__, ver_end__) \ 177 163 { .match_type = XE_RTP_MATCH_MEDIA_VERSION_RANGE, \ 178 164 .ver_start = ver_start__, .ver_end = ver_end__, } 165 + 166 + /** 167 + * XE_RTP_RULE_MEDIA_VERSION_ANY_GT - Create rule matching media version on any GT 168 + * @ver__: Media IP version to match 169 + * 170 + * Like XE_RTP_RULE_MEDIA_VERSION, but it matches even if the current GT being 171 + * checked is not of the media type. It allows to add RTP entries to another 172 + * GT when the device contains a Media IP with that version. 173 + * 174 + * Refer to XE_RTP_RULES() for expected usage. 175 + */ 176 + #define XE_RTP_RULE_MEDIA_VERSION_ANY_GT(ver__) \ 177 + { .match_type = XE_RTP_MATCH_MEDIA_VERSION_ANY_GT, \ 178 + .ver_start = ver__, } 179 179 180 180 /** 181 181 * XE_RTP_RULE_IS_INTEGRATED - Create a rule matching integrated graphics devices
+2
drivers/gpu/drm/xe/xe_rtp_types.h
··· 42 42 XE_RTP_MATCH_SUBPLATFORM, 43 43 XE_RTP_MATCH_GRAPHICS_VERSION, 44 44 XE_RTP_MATCH_GRAPHICS_VERSION_RANGE, 45 + XE_RTP_MATCH_GRAPHICS_VERSION_ANY_GT, 45 46 XE_RTP_MATCH_GRAPHICS_STEP, 46 47 XE_RTP_MATCH_MEDIA_VERSION, 47 48 XE_RTP_MATCH_MEDIA_VERSION_RANGE, 49 + XE_RTP_MATCH_MEDIA_VERSION_ANY_GT, 48 50 XE_RTP_MATCH_MEDIA_STEP, 49 51 XE_RTP_MATCH_INTEGRATED, 50 52 XE_RTP_MATCH_DISCRETE,