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

drm/i915/sprite: convert intel_sprite_uapi.c to struct intel_display

Going forward, struct intel_display is the main display device data
pointer. Convert intel_sprite_uapi.c to struct intel_display.

Reviewed-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
Link: https://lore.kernel.org/r/d4f71c2976a1a28b4e74c2fc1097090fe7f78743.1744222449.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Jani Nikula c370285b 46b58718

+8 -9
+8 -9
drivers/gpu/drm/i915/display/intel_sprite_uapi.c
··· 3 3 * Copyright © 2023 Intel Corporation 4 4 */ 5 5 6 - #include "i915_drv.h" 7 6 #include "intel_crtc.h" 7 + #include "intel_display_core.h" 8 8 #include "intel_display_types.h" 9 9 #include "intel_sprite_uapi.h" 10 10 11 - static bool has_dst_key_in_primary_plane(struct drm_i915_private *dev_priv) 11 + static bool has_dst_key_in_primary_plane(struct intel_display *display) 12 12 { 13 - return DISPLAY_VER(dev_priv) >= 9; 13 + return DISPLAY_VER(display) >= 9; 14 14 } 15 15 16 16 static void intel_plane_set_ckey(struct intel_plane_state *plane_state, 17 17 const struct drm_intel_sprite_colorkey *set) 18 18 { 19 + struct intel_display *display = to_intel_display(plane_state); 19 20 struct intel_plane *plane = to_intel_plane(plane_state->uapi.plane); 20 - struct drm_i915_private *dev_priv = to_i915(plane->base.dev); 21 21 struct drm_intel_sprite_colorkey *key = &plane_state->ckey; 22 22 23 23 *key = *set; ··· 34 34 * On SKL+ we want dst key enabled on 35 35 * the primary and not on the sprite. 36 36 */ 37 - if (DISPLAY_VER(dev_priv) >= 9 && plane->id != PLANE_PRIMARY && 37 + if (DISPLAY_VER(display) >= 9 && plane->id != PLANE_PRIMARY && 38 38 set->flags & I915_SET_COLORKEY_DESTINATION) 39 39 key->flags = 0; 40 40 } ··· 43 43 struct drm_file *file_priv) 44 44 { 45 45 struct intel_display *display = to_intel_display(dev); 46 - struct drm_i915_private *dev_priv = to_i915(dev); 47 46 struct drm_intel_sprite_colorkey *set = data; 48 47 struct drm_plane *plane; 49 48 struct drm_plane_state *plane_state; ··· 60 61 if ((set->flags & (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) == (I915_SET_COLORKEY_DESTINATION | I915_SET_COLORKEY_SOURCE)) 61 62 return -EINVAL; 62 63 63 - if ((IS_VALLEYVIEW(dev_priv) || IS_CHERRYVIEW(dev_priv)) && 64 + if ((display->platform.valleyview || display->platform.cherryview) && 64 65 set->flags & I915_SET_COLORKEY_DESTINATION) 65 66 return -EINVAL; 66 67 ··· 73 74 * Also multiple planes can't do destination keying on the same 74 75 * pipe simultaneously. 75 76 */ 76 - if (DISPLAY_VER(dev_priv) >= 9 && 77 + if (DISPLAY_VER(display) >= 9 && 77 78 to_intel_plane(plane)->id >= PLANE_3 && 78 79 set->flags & I915_SET_COLORKEY_DESTINATION) 79 80 return -EINVAL; ··· 98 99 * On some platforms we have to configure 99 100 * the dst colorkey on the primary plane. 100 101 */ 101 - if (!ret && has_dst_key_in_primary_plane(dev_priv)) { 102 + if (!ret && has_dst_key_in_primary_plane(display)) { 102 103 struct intel_crtc *crtc = 103 104 intel_crtc_for_pipe(display, 104 105 to_intel_plane(plane)->pipe);