Commit 66f01114 authored by Dmitry Baryshkov's avatar Dmitry Baryshkov Committed by Maxime Ripard

drm/atomic-helper: rename drm_atomic_helper_check_wb_encoder_state

The drm_atomic_helper_check_wb_encoder_state() function doesn't use
encoder for anything other than getting the drm_device instance. The
function's description talks about checking the writeback connector
state, not the encoder state. Moreover, there is no such thing as an
encoder state, encoders generally do not have a state on their own.

Rename the function to drm_atomic_helper_check_wb_connector_state()
and change arguments to drm_writeback_connector and drm_atomic_state.
Signed-off-by: default avatarDmitry Baryshkov <dmitry.baryshkov@linaro.org>
Signed-off-by: default avatarMaxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231208010314.3395904-2-dmitry.baryshkov@linaro.org
parent 67a5f0ff
...@@ -795,9 +795,9 @@ drm_atomic_helper_check_modeset(struct drm_device *dev, ...@@ -795,9 +795,9 @@ drm_atomic_helper_check_modeset(struct drm_device *dev,
EXPORT_SYMBOL(drm_atomic_helper_check_modeset); EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
/** /**
* drm_atomic_helper_check_wb_encoder_state() - Check writeback encoder state * drm_atomic_helper_check_wb_connector_state() - Check writeback connector state
* @encoder: encoder state to check * @connector: corresponding connector
* @conn_state: connector state to check * @state: the driver state object
* *
* Checks if the writeback connector state is valid, and returns an error if it * Checks if the writeback connector state is valid, and returns an error if it
* isn't. * isn't.
...@@ -806,9 +806,11 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset); ...@@ -806,9 +806,11 @@ EXPORT_SYMBOL(drm_atomic_helper_check_modeset);
* Zero for success or -errno * Zero for success or -errno
*/ */
int int
drm_atomic_helper_check_wb_encoder_state(struct drm_encoder *encoder, drm_atomic_helper_check_wb_connector_state(struct drm_connector *connector,
struct drm_connector_state *conn_state) struct drm_atomic_state *state)
{ {
struct drm_connector_state *conn_state =
drm_atomic_get_new_connector_state(state, connector);
struct drm_writeback_job *wb_job = conn_state->writeback_job; struct drm_writeback_job *wb_job = conn_state->writeback_job;
struct drm_property_blob *pixel_format_blob; struct drm_property_blob *pixel_format_blob;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
...@@ -827,11 +829,11 @@ drm_atomic_helper_check_wb_encoder_state(struct drm_encoder *encoder, ...@@ -827,11 +829,11 @@ drm_atomic_helper_check_wb_encoder_state(struct drm_encoder *encoder,
if (fb->format->format == formats[i]) if (fb->format->format == formats[i])
return 0; return 0;
drm_dbg_kms(encoder->dev, "Invalid pixel format %p4cc\n", &fb->format->format); drm_dbg_kms(connector->dev, "Invalid pixel format %p4cc\n", &fb->format->format);
return -EINVAL; return -EINVAL;
} }
EXPORT_SYMBOL(drm_atomic_helper_check_wb_encoder_state); EXPORT_SYMBOL(drm_atomic_helper_check_wb_connector_state);
/** /**
* drm_atomic_helper_check_plane_state() - Check plane state for validity * drm_atomic_helper_check_plane_state() - Check plane state for validity
......
...@@ -34,6 +34,7 @@ static int vkms_wb_encoder_atomic_check(struct drm_encoder *encoder, ...@@ -34,6 +34,7 @@ static int vkms_wb_encoder_atomic_check(struct drm_encoder *encoder,
struct drm_crtc_state *crtc_state, struct drm_crtc_state *crtc_state,
struct drm_connector_state *conn_state) struct drm_connector_state *conn_state)
{ {
struct drm_connector *connector = conn_state->connector;
struct drm_framebuffer *fb; struct drm_framebuffer *fb;
const struct drm_display_mode *mode = &crtc_state->mode; const struct drm_display_mode *mode = &crtc_state->mode;
int ret; int ret;
...@@ -48,7 +49,7 @@ static int vkms_wb_encoder_atomic_check(struct drm_encoder *encoder, ...@@ -48,7 +49,7 @@ static int vkms_wb_encoder_atomic_check(struct drm_encoder *encoder,
return -EINVAL; return -EINVAL;
} }
ret = drm_atomic_helper_check_wb_encoder_state(encoder, conn_state); ret = drm_atomic_helper_check_wb_connector_state(connector, conn_state->state);
if (ret < 0) if (ret < 0)
return ret; return ret;
......
...@@ -49,9 +49,8 @@ struct drm_private_state; ...@@ -49,9 +49,8 @@ struct drm_private_state;
int drm_atomic_helper_check_modeset(struct drm_device *dev, int drm_atomic_helper_check_modeset(struct drm_device *dev,
struct drm_atomic_state *state); struct drm_atomic_state *state);
int int drm_atomic_helper_check_wb_connector_state(struct drm_connector *connector,
drm_atomic_helper_check_wb_encoder_state(struct drm_encoder *encoder, struct drm_atomic_state *state);
struct drm_connector_state *conn_state);
int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state, int drm_atomic_helper_check_plane_state(struct drm_plane_state *plane_state,
const struct drm_crtc_state *crtc_state, const struct drm_crtc_state *crtc_state,
int min_scale, int min_scale,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment