Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions drivers/gpu/drm/vc4/vc4_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1087,6 +1087,7 @@ extern struct platform_driver vc4_vec_driver;

/* vc4_txp.c */
extern struct platform_driver vc4_txp_driver;
void vc4_txp_connector_reset(struct drm_connector *connector);

/* vc4_irq.c */
void vc4_irq_enable(struct drm_device *dev);
Expand Down
26 changes: 21 additions & 5 deletions drivers/gpu/drm/vc4/vc4_txp.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,11 @@ static int vc4_txp_connector_atomic_check(struct drm_connector *conn,

fb = conn_state->writeback_job->fb;
if ((conn_state->rotation == DRM_MODE_ROTATE_0 &&
fb->width != crtc_state->mode.hdisplay &&
fb->height != crtc_state->mode.vdisplay) ||
(fb->width != crtc_state->mode.hdisplay ||
fb->height != crtc_state->mode.vdisplay)) ||
(conn_state->rotation == (DRM_MODE_ROTATE_0 | DRM_MODE_TRANSPOSE) &&
fb->width != crtc_state->mode.vdisplay &&
fb->height != crtc_state->mode.hdisplay)) {
(fb->width != crtc_state->mode.vdisplay ||
fb->height != crtc_state->mode.hdisplay))) {
DRM_DEBUG_KMS("Invalid framebuffer size %ux%u vs mode %ux%u\n",
fb->width, fb->height,
crtc_state->mode.hdisplay, crtc_state->mode.vdisplay);
Expand Down Expand Up @@ -390,11 +390,27 @@ vc4_txp_connector_detect(struct drm_connector *connector, bool force)
return connector_status_connected;
}

void vc4_txp_connector_reset(struct drm_connector *connector)
{
uint64_t rotation = DRM_MODE_ROTATE_0;

drm_atomic_helper_connector_reset(connector);

if (connector->state) {
if (connector->rotation_property)
drm_object_property_get_default_value(&connector->base,
connector->rotation_property,
&rotation);

connector->state->rotation = rotation;
}
}

static const struct drm_connector_funcs vc4_txp_connector_funcs = {
.detect = vc4_txp_connector_detect,
.fill_modes = drm_helper_probe_single_connector_modes,
.destroy = drm_connector_cleanup,
.reset = drm_atomic_helper_connector_reset,
.reset = vc4_txp_connector_reset,
.atomic_duplicate_state = drm_atomic_helper_connector_duplicate_state,
.atomic_destroy_state = drm_atomic_helper_connector_destroy_state,
};
Expand Down