]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - drivers/gpu/drm/amd/display/dc/dc.h
drm/amd/display: Rename more dc_surface stuff to plane_state
[mirror_ubuntu-bionic-kernel.git] / drivers / gpu / drm / amd / display / dc / dc.h
index 0918569eefa86d6e46ba278cf1444bb33730d445..d1a6398043a3cd8fb93df81e3a47e5882f1c28b0 100644 (file)
@@ -47,7 +47,7 @@ struct dc_caps {
        uint32_t max_links;
        uint32_t max_audios;
        uint32_t max_slave_planes;
-       uint32_t max_surfaces;
+       uint32_t max_planes;
        uint32_t max_downscale_ratio;
        uint32_t i2c_speed_in_khz;
 
@@ -92,43 +92,39 @@ struct dc_static_screen_events {
 
 /* Forward declaration*/
 struct dc;
-struct dc_surface;
+struct dc_plane_state;
 struct validate_context;
 
 struct dc_cap_funcs {
-#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
        bool (*get_dcc_compression_cap)(const struct dc *dc,
                        const struct dc_dcc_surface_param *input,
                        struct dc_surface_dcc_cap *output);
-#else
-       int i;
-#endif
 };
 
-struct dc_stream_funcs {
+struct dc_stream_state_funcs {
        bool (*adjust_vmin_vmax)(struct dc *dc,
-                       struct dc_stream **stream,
+                       struct dc_stream_state **stream,
                        int num_streams,
                        int vmin,
                        int vmax);
        bool (*get_crtc_position)(struct dc *dc,
-                       struct dc_stream **stream,
+                       struct dc_stream_state **stream,
                        int num_streams,
                        unsigned int *v_pos,
                        unsigned int *nom_v_pos);
 
        bool (*set_gamut_remap)(struct dc *dc,
-                       const struct dc_stream *stream);
+                       const struct dc_stream_state *stream);
 
        bool (*program_csc_matrix)(struct dc *dc,
-                       struct dc_stream *stream);
+                       struct dc_stream_state *stream);
 
        void (*set_static_screen_events)(struct dc *dc,
-                       struct dc_stream **stream,
+                       struct dc_stream_state **stream,
                        int num_streams,
                        const struct dc_static_screen_events *events);
 
-       void (*set_dither_option)(struct dc_stream *stream,
+       void (*set_dither_option)(struct dc_stream_state *stream,
                        enum dc_dither_option option);
 };
 
@@ -171,7 +167,6 @@ struct dc_debug {
        bool disable_stutter;
        bool disable_dcc;
        bool disable_dfs_bypass;
-#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
        bool disable_dpp_power_gate;
        bool disable_hubp_power_gate;
        bool disable_pplib_wm_range;
@@ -185,7 +180,6 @@ struct dc_debug {
        int percent_of_ideal_drambw;
        int dram_clock_change_latency_ns;
        int always_scale;
-#endif
        bool disable_pplib_clock_request;
        bool disable_clock_gate;
        bool disable_dmcu;
@@ -196,7 +190,7 @@ struct dc_debug {
 struct dc {
        struct dc_caps caps;
        struct dc_cap_funcs cap_funcs;
-       struct dc_stream_funcs stream_funcs;
+       struct dc_stream_state_funcs stream_funcs;
        struct dc_link_funcs link_funcs;
        struct dc_config config;
        struct dc_debug debug;
@@ -309,14 +303,14 @@ struct dc_transfer_func {
  * the last requested address and the currently active address so the called
  * can determine if there are any outstanding flips
  */
-struct dc_surface_status {
+struct dc_plane_status {
        struct dc_plane_address requested_address;
        struct dc_plane_address current_address;
        bool is_flip_pending;
        bool is_right_eye;
 };
 
-struct dc_surface {
+struct dc_plane_state {
        struct dc_plane_address address;
 
        struct scaling_taps scaling_quality;
@@ -344,7 +338,7 @@ struct dc_surface {
        bool horizontal_mirror;
 
        /* private to DC core */
-       struct dc_surface_status status;
+       struct dc_plane_status status;
        struct dc_context *ctx;
 
        /* private to dc_surface.c */
@@ -373,7 +367,7 @@ struct dc_scaling_info {
 };
 
 struct dc_surface_update {
-       struct dc_surface *surface;
+       struct dc_plane_state *surface;
 
        /* isr safe update parameters.  null means no updates */
        struct dc_flip_addrs *flip_addr;
@@ -391,12 +385,12 @@ struct dc_surface_update {
 /*
  * Create a new surface with default parameters;
  */
-struct dc_surface *dc_create_surface(const struct dc *dc);
-const struct dc_surface_status *dc_surface_get_status(
-               const struct dc_surface *dc_surface);
+struct dc_plane_state *dc_create_plane_state(const struct dc *dc);
+const struct dc_plane_status *dc_plane_get_status(
+               const struct dc_plane_state *plane_state);
 
-void dc_surface_retain(struct dc_surface *dc_surface);
-void dc_surface_release(struct dc_surface *dc_surface);
+void dc_plane_state_retain(struct dc_plane_state *plane_state);
+void dc_plane_state_release(struct dc_plane_state *plane_state);
 
 void dc_gamma_retain(struct dc_gamma *dc_gamma);
 void dc_gamma_release(struct dc_gamma **dc_gamma);
@@ -428,11 +422,11 @@ struct dc_flip_addrs {
  *   This does not trigger a flip.  No surface address is programmed.
  */
 
-bool dc_commit_surfaces_to_stream(
+bool dc_commit_planes_to_stream(
                struct dc *dc,
-               struct dc_surface **dc_surfaces,
-               uint8_t surface_count,
-               struct dc_stream *stream);
+               struct dc_plane_state **plane_states,
+               uint8_t new_plane_count,
+               struct dc_stream_state *stream);
 
 bool dc_post_update_surfaces_to_stream(
                struct dc *dc);
@@ -475,8 +469,8 @@ enum surface_update_type {
 
 struct dc_stream_status {
        int primary_otg_inst;
-       int surface_count;
-       struct dc_surface *surfaces[MAX_SURFACE_NUM];
+       int plane_count;
+       struct dc_plane_state *plane_states[MAX_SURFACE_NUM];
 
        /*
         * link this stream passes through
@@ -484,7 +478,7 @@ struct dc_stream_status {
        struct dc_link *link;
 };
 
-struct dc_stream {
+struct dc_stream_state {
        struct dc_sink *sink;
        struct dc_crtc_timing timing;
 
@@ -535,7 +529,7 @@ struct dc_stream_update {
 };
 
 bool dc_is_stream_unchanged(
-       struct dc_stream *old_stream, struct dc_stream *stream);
+       struct dc_stream_state *old_stream, struct dc_stream_state *stream);
 
 /*
  * Setup stream attributes if no stream updates are provided
@@ -552,32 +546,32 @@ bool dc_is_stream_unchanged(
  *
  */
 
-void dc_update_surfaces_and_stream(struct dc *dc,
+void dc_update_planes_and_stream(struct dc *dc,
                struct dc_surface_update *surface_updates, int surface_count,
-               struct dc_stream *dc_stream,
+               struct dc_stream_state *dc_stream,
                struct dc_stream_update *stream_update);
 
 /*
  * Log the current stream state.
  */
 void dc_stream_log(
-       const struct dc_stream *stream,
+       const struct dc_stream_state *stream,
        struct dal_logger *dc_logger,
        enum dc_log_type log_type);
 
 uint8_t dc_get_current_stream_count(const struct dc *dc);
-struct dc_stream *dc_get_stream_at_index(const struct dc *dc, uint8_t i);
+struct dc_stream_state *dc_get_stream_at_index(const struct dc *dc, uint8_t i);
 
 /*
  * Return the current frame counter.
  */
-uint32_t dc_stream_get_vblank_counter(const struct dc_stream *stream);
+uint32_t dc_stream_get_vblank_counter(const struct dc_stream_state *stream);
 
 /* TODO: Return parsed values rather than direct register read
  * This has a dependency on the caller (amdgpu_get_crtc_scanoutpos)
  * being refactored properly to be dce-specific
  */
-bool dc_stream_get_scanoutpos(const struct dc_stream *stream,
+bool dc_stream_get_scanoutpos(const struct dc_stream_state *stream,
                                  uint32_t *v_blank_start,
                                  uint32_t *v_blank_end,
                                  uint32_t *h_position,
@@ -587,14 +581,14 @@ bool dc_stream_get_scanoutpos(const struct dc_stream *stream,
  * Structure to store surface/stream associations for validation
  */
 struct dc_validation_set {
-       struct dc_stream *stream;
-       struct dc_surface *surfaces[MAX_SURFACES];
-       uint8_t surface_count;
+       struct dc_stream_state *stream;
+       struct dc_plane_state *plane_states[MAX_SURFACES];
+       uint8_t plane_count;
 };
 
-bool dc_validate_stream(const struct dc *dc, struct dc_stream *stream);
+bool dc_validate_stream(const struct dc *dc, struct dc_stream_state *stream);
 
-bool dc_validate_surface(const struct dc *dc, const struct dc_surface *surface);
+bool dc_validate_plane(const struct dc *dc, const struct dc_plane_state *plane_state);
 /*
  * This function takes a set of resources and checks that they are cofunctional.
  *
@@ -621,7 +615,7 @@ bool dc_validate_resources(
 
 bool dc_validate_guaranteed(
                const struct dc *dc,
-               struct dc_stream *stream);
+               struct dc_stream_state *stream);
 
 void dc_resource_validate_ctx_copy_construct(
                const struct validate_context *src_ctx,
@@ -650,7 +644,7 @@ bool dc_commit_context(struct dc *dc, struct validate_context *context);
  */
 bool dc_commit_streams(
                struct dc *dc,
-               struct dc_stream *streams[],
+               struct dc_stream_state *streams[],
                uint8_t stream_count);
 /*
  * Enable stereo when commit_streams is not required,
@@ -659,19 +653,19 @@ bool dc_commit_streams(
 bool dc_enable_stereo(
        struct dc *dc,
        struct validate_context *context,
-       struct dc_stream *streams[],
+       struct dc_stream_state *streams[],
        uint8_t stream_count);
 
 /**
  * Create a new default stream for the requested sink
  */
-struct dc_stream *dc_create_stream_for_sink(struct dc_sink *dc_sink);
+struct dc_stream_state *dc_create_stream_for_sink(struct dc_sink *dc_sink);
 
-void dc_stream_retain(struct dc_stream *dc_stream);
-void dc_stream_release(struct dc_stream *dc_stream);
+void dc_stream_retain(struct dc_stream_state *dc_stream);
+void dc_stream_release(struct dc_stream_state *dc_stream);
 
 struct dc_stream_status *dc_stream_get_status(
-       struct dc_stream *dc_stream);
+       struct dc_stream_state *dc_stream);
 
 enum surface_update_type dc_check_update_surfaces_for_stream(
                struct dc *dc,
@@ -810,7 +804,7 @@ const struct graphics_object_id dc_get_link_id_at_index(
 
 /* Set backlight level of an embedded panel (eDP, LVDS). */
 bool dc_link_set_backlight_level(const struct dc_link *dc_link, uint32_t level,
-               uint32_t frame_ramp, const struct dc_stream *stream);
+               uint32_t frame_ramp, const struct dc_stream_state *stream);
 
 bool dc_link_set_abm_disable(const struct dc_link *dc_link);
 
@@ -819,7 +813,7 @@ bool dc_link_set_psr_enable(const struct dc_link *dc_link, bool enable);
 bool dc_link_get_psr_state(const struct dc_link *dc_link, uint32_t *psr_state);
 
 bool dc_link_setup_psr(struct dc_link *dc_link,
-               const struct dc_stream *stream, struct psr_config *psr_config,
+               const struct dc_stream_state *stream, struct psr_config *psr_config,
                struct psr_context *psr_context);
 
 /* Request DC to detect if there is a Panel connected.
@@ -933,11 +927,11 @@ bool dc_sink_set_container_id(struct dc_sink *dc_sink, const struct dc_container
  ******************************************************************************/
 /* TODO: Deprecated once we switch to dc_set_cursor_position */
 bool dc_stream_set_cursor_attributes(
-       const struct dc_stream *stream,
+       const struct dc_stream_state *stream,
        const struct dc_cursor_attributes *attributes);
 
 bool dc_stream_set_cursor_position(
-       struct dc_stream *stream,
+       struct dc_stream_state *stream,
        const struct dc_cursor_position *position);
 
 /* Newer interfaces  */