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

Configure Feed

Select the types of activity you want to include in your feed.

drm/atomic: convert drm_atomic_get_{old, new}_colorop_state() into proper functions

There is no real reason to include drm_colorop.h from drm_atomic.h, as
drm_atomic_get_{old,new}_colorop_state() have no real reason to be
static inline.

Convert the static inlines to proper functions, and drop the include to
reduce the include dependencies and improve data hiding.

v2: Fix vkms build failures (Alex)

Fixes: cfc27680ee20 ("drm/colorop: Introduce new drm_colorop mode object")
Cc: Simon Ser <contact@emersion.fr>
Cc: Alex Hung <alex.hung@amd.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Cc: Daniel Stone <daniels@collabora.com>
Cc: Melissa Wen <mwen@igalia.com>
Cc: Sebastian Wick <sebastian.wick@redhat.com>
Cc: Alex Hung <alex.hung@amd.com>
Reviewed-by: Alex Hung <alex.hung@amd.com>
Link: https://patch.msgid.link/20251219114939.1069851-1-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+47 -31
+3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.c
··· 23 23 * Authors: AMD 24 24 * 25 25 */ 26 + 27 + #include <drm/drm_colorop.h> 28 + 26 29 #include "amdgpu.h" 27 30 #include "amdgpu_mode.h" 28 31 #include "amdgpu_dm.h"
+32
drivers/gpu/drm/drm_atomic.c
··· 641 641 } 642 642 EXPORT_SYMBOL(drm_atomic_get_colorop_state); 643 643 644 + /** 645 + * drm_atomic_get_old_colorop_state - get colorop state, if it exists 646 + * @state: global atomic state object 647 + * @colorop: colorop to grab 648 + * 649 + * This function returns the old colorop state for the given colorop, or 650 + * NULL if the colorop is not part of the global atomic state. 651 + */ 652 + struct drm_colorop_state * 653 + drm_atomic_get_old_colorop_state(struct drm_atomic_state *state, 654 + struct drm_colorop *colorop) 655 + { 656 + return state->colorops[drm_colorop_index(colorop)].old_state; 657 + } 658 + EXPORT_SYMBOL(drm_atomic_get_old_colorop_state); 659 + 660 + /** 661 + * drm_atomic_get_new_colorop_state - get colorop state, if it exists 662 + * @state: global atomic state object 663 + * @colorop: colorop to grab 664 + * 665 + * This function returns the new colorop state for the given colorop, or 666 + * NULL if the colorop is not part of the global atomic state. 667 + */ 668 + struct drm_colorop_state * 669 + drm_atomic_get_new_colorop_state(struct drm_atomic_state *state, 670 + struct drm_colorop *colorop) 671 + { 672 + return state->colorops[drm_colorop_index(colorop)].new_state; 673 + } 674 + EXPORT_SYMBOL(drm_atomic_get_new_colorop_state); 675 + 644 676 static bool 645 677 plane_switching_crtc(const struct drm_plane_state *old_plane_state, 646 678 const struct drm_plane_state *new_plane_state)
+1
drivers/gpu/drm/drm_atomic_helper.c
··· 34 34 #include <drm/drm_atomic_uapi.h> 35 35 #include <drm/drm_blend.h> 36 36 #include <drm/drm_bridge.h> 37 + #include <drm/drm_colorop.h> 37 38 #include <drm/drm_damage_helper.h> 38 39 #include <drm/drm_device.h> 39 40 #include <drm/drm_drv.h>
+1
drivers/gpu/drm/i915/display/intel_display_types.h
··· 34 34 #include <drm/display/drm_dp_tunnel.h> 35 35 #include <drm/display/drm_dsc.h> 36 36 #include <drm/drm_atomic.h> 37 + #include <drm/drm_colorop.h> 37 38 #include <drm/drm_crtc.h> 38 39 #include <drm/drm_encoder.h> 39 40 #include <drm/drm_framebuffer.h>
+1
drivers/gpu/drm/vkms/vkms_composer.c
··· 5 5 #include <drm/drm_atomic.h> 6 6 #include <drm/drm_atomic_helper.h> 7 7 #include <drm/drm_blend.h> 8 + #include <drm/drm_colorop.h> 8 9 #include <drm/drm_fourcc.h> 9 10 #include <drm/drm_fixed.h> 10 11 #include <drm/drm_gem_framebuffer_helper.h>
+1
drivers/gpu/drm/vkms/vkms_drv.c
··· 17 17 #include <drm/drm_gem.h> 18 18 #include <drm/drm_atomic.h> 19 19 #include <drm/drm_atomic_helper.h> 20 + #include <drm/drm_colorop.h> 20 21 #include <drm/drm_drv.h> 21 22 #include <drm/drm_fbdev_shmem.h> 22 23 #include <drm/drm_file.h>
+8 -31
include/drm/drm_atomic.h
··· 30 30 31 31 #include <drm/drm_crtc.h> 32 32 #include <drm/drm_util.h> 33 - #include <drm/drm_colorop.h> 34 33 35 34 /** 36 35 * struct drm_crtc_commit - track modeset commits on a CRTC ··· 711 712 struct drm_colorop_state * 712 713 drm_atomic_get_colorop_state(struct drm_atomic_state *state, 713 714 struct drm_colorop *colorop); 715 + 716 + struct drm_colorop_state * 717 + drm_atomic_get_old_colorop_state(struct drm_atomic_state *state, 718 + struct drm_colorop *colorop); 719 + struct drm_colorop_state * 720 + drm_atomic_get_new_colorop_state(struct drm_atomic_state *state, 721 + struct drm_colorop *colorop); 722 + 714 723 struct drm_connector_state * __must_check 715 724 drm_atomic_get_connector_state(struct drm_atomic_state *state, 716 725 struct drm_connector *connector); ··· 813 806 struct drm_plane *plane) 814 807 { 815 808 return state->planes[drm_plane_index(plane)].new_state; 816 - } 817 - 818 - /** 819 - * drm_atomic_get_old_colorop_state - get colorop state, if it exists 820 - * @state: global atomic state object 821 - * @colorop: colorop to grab 822 - * 823 - * This function returns the old colorop state for the given colorop, or 824 - * NULL if the colorop is not part of the global atomic state. 825 - */ 826 - static inline struct drm_colorop_state * 827 - drm_atomic_get_old_colorop_state(struct drm_atomic_state *state, 828 - struct drm_colorop *colorop) 829 - { 830 - return state->colorops[drm_colorop_index(colorop)].old_state; 831 - } 832 - 833 - /** 834 - * drm_atomic_get_new_colorop_state - get colorop state, if it exists 835 - * @state: global atomic state object 836 - * @colorop: colorop to grab 837 - * 838 - * This function returns the new colorop state for the given colorop, or 839 - * NULL if the colorop is not part of the global atomic state. 840 - */ 841 - static inline struct drm_colorop_state * 842 - drm_atomic_get_new_colorop_state(struct drm_atomic_state *state, 843 - struct drm_colorop *colorop) 844 - { 845 - return state->colorops[drm_colorop_index(colorop)].new_state; 846 809 } 847 810 848 811 /**