Lines Matching refs:state

57  * @state: the CRTC whose incoming state to update
60 * Set a mode (originating from the kernel) on the desired CRTC state and update
66 int drm_atomic_set_mode_for_crtc(struct drm_crtc_state *state,
69 struct drm_crtc *crtc = state->crtc;
73 if (mode && memcmp(&state->mode, mode, sizeof(*mode)) == 0)
76 drm_property_blob_put(state->mode_blob);
77 state->mode_blob = NULL;
88 drm_mode_copy(&state->mode, mode);
90 state->mode_blob = blob;
91 state->enable = true;
93 "Set [MODE:%s] for [CRTC:%d:%s] state %p\n",
94 mode->name, crtc->base.id, crtc->name, state);
96 memset(&state->mode, 0, sizeof(state->mode));
97 state->enable = false;
99 "Set [NOMODE] for [CRTC:%d:%s] state %p\n",
100 crtc->base.id, crtc->name, state);
109 * @state: the CRTC whose incoming state to update
112 * Set a mode (originating from a blob property) on the desired CRTC state.
113 * This function will take a reference on the blob property for the CRTC state,
114 * and release the reference held on the state's existing mode property, if any
120 int drm_atomic_set_mode_prop_for_crtc(struct drm_crtc_state *state,
123 struct drm_crtc *crtc = state->crtc;
125 if (blob == state->mode_blob)
128 drm_property_blob_put(state->mode_blob);
129 state->mode_blob = NULL;
131 memset(&state->mode, 0, sizeof(state->mode));
145 &state->mode, blob->data);
150 ret, drm_get_mode_status_name(state->mode.status));
151 drm_mode_debug_printmodeline(&state->mode);
155 state->mode_blob = drm_property_blob_get(blob);
156 state->enable = true;
158 "Set [MODE:%s] for [CRTC:%d:%s] state %p\n",
159 state->mode.name, crtc->base.id, crtc->name,
160 state);
162 state->enable = false;
164 "Set [NOMODE] for [CRTC:%d:%s] state %p\n",
165 crtc->base.id, crtc->name, state);
174 * @plane_state: the plane whose incoming state to update
177 * Changing the assigned CRTC for a plane requires us to grab the lock and state
179 * besides updating the pointer in the state object itself.
196 crtc_state = drm_atomic_get_crtc_state(plane_state->state,
207 crtc_state = drm_atomic_get_crtc_state(plane_state->state,
216 "Link [PLANE:%d:%s] state %p to [CRTC:%d:%s]\n",
221 "Link [PLANE:%d:%s] state %p to [NOCRTC]\n",
230 * @plane_state: atomic state object for the plane
236 * state object itself.
246 "Set [FB:%d] for [PLANE:%d:%s] state %p\n",
251 "Set [NOFB] for [PLANE:%d:%s] state %p\n",
260 * @conn_state: atomic state object for the connector
264 * state for the new CRTC, as needed. This function takes care of all these
265 * details besides updating the pointer in the state object itself.
283 crtc_state = drm_atomic_get_new_crtc_state(conn_state->state,
294 crtc_state = drm_atomic_get_crtc_state(conn_state->state, crtc);
305 "Link [CONNECTOR:%d:%s] state %p to [CRTC:%d:%s]\n",
310 "Link [CONNECTOR:%d:%s] state %p to [NOCRTC]\n",
319 static void set_out_fence_for_crtc(struct drm_atomic_state *state,
322 state->crtcs[drm_crtc_index(crtc)].out_fence_ptr = fence_ptr;
325 static s32 __user *get_out_fence_for_crtc(struct drm_atomic_state *state,
330 fence_ptr = state->crtcs[drm_crtc_index(crtc)].out_fence_ptr;
331 state->crtcs[drm_crtc_index(crtc)].out_fence_ptr = NULL;
336 static int set_out_fence_for_connector(struct drm_atomic_state *state,
348 state->connectors[index].out_fence_ptr = fence_ptr;
353 static s32 __user *get_out_fence_for_connector(struct drm_atomic_state *state,
359 fence_ptr = state->connectors[index].out_fence_ptr;
360 state->connectors[index].out_fence_ptr = NULL;
408 struct drm_crtc_state *state, struct drm_property *property,
417 state->active = val;
421 ret = drm_atomic_set_mode_prop_for_crtc(state, mode);
425 state->vrr_enabled = val;
428 &state->degamma_lut,
432 state->color_mgmt_changed |= replaced;
436 &state->ctm,
440 state->color_mgmt_changed |= replaced;
444 &state->gamma_lut,
448 state->color_mgmt_changed |= replaced;
459 set_out_fence_for_crtc(state->state, crtc, fence_ptr);
461 state->scaling_filter = val;
463 return crtc->funcs->atomic_set_property(crtc, state, property, val);
477 const struct drm_crtc_state *state,
484 *val = drm_atomic_crtc_effectively_active(state);
486 *val = (state->mode_blob) ? state->mode_blob->base.id : 0;
488 *val = state->vrr_enabled;
490 *val = (state->degamma_lut) ? state->degamma_lut->base.id : 0;
492 *val = (state->ctm) ? state->ctm->base.id : 0;
494 *val = (state->gamma_lut) ? state->gamma_lut->base.id : 0;
498 *val = state->scaling_filter;
500 return crtc->funcs->atomic_get_property(crtc, state, property, val);
513 struct drm_plane_state *state, struct drm_file *file_priv,
525 drm_atomic_set_fb_for_plane(state, fb);
529 if (state->fence)
535 state->fence = sync_file_get_fence(val);
536 if (!state->fence)
548 return drm_atomic_set_crtc_for_plane(state, crtc);
550 state->crtc_x = U642I64(val);
552 state->crtc_y = U642I64(val);
554 state->crtc_w = val;
556 state->crtc_h = val;
558 state->src_x = val;
560 state->src_y = val;
562 state->src_w = val;
564 state->src_h = val;
566 state->alpha = val;
568 state->pixel_blend_mode = val;
576 state->rotation = val;
578 state->zpos = val;
580 state->color_encoding = val;
582 state->color_range = val;
585 &state->fb_damage_clips,
592 state->scaling_filter = val;
594 return plane->funcs->atomic_set_property(plane, state,
609 const struct drm_plane_state *state,
616 *val = (state->fb) ? state->fb->base.id : 0;
620 *val = (state->crtc) ? state->crtc->base.id : 0;
622 *val = I642U64(state->crtc_x);
624 *val = I642U64(state->crtc_y);
626 *val = state->crtc_w;
628 *val = state->crtc_h;
630 *val = state->src_x;
632 *val = state->src_y;
634 *val = state->src_w;
636 *val = state->src_h;
638 *val = state->alpha;
640 *val = state->pixel_blend_mode;
642 *val = state->rotation;
644 *val = state->zpos;
646 *val = state->color_encoding;
648 *val = state->color_range;
650 *val = (state->fb_damage_clips) ?
651 state->fb_damage_clips->base.id : 0;
653 *val = state->scaling_filter;
655 return plane->funcs->atomic_get_property(plane, state, property, val);
680 "Set [FB:%d] for connector state %p\n",
684 "Set [NOFB] for connector state %p\n",
691 struct drm_connector_state *state, struct drm_file *file_priv,
708 return drm_atomic_set_crtc_for_connector(state, crtc);
719 state->tv.select_subconnector = val;
721 state->tv.subconnector = val;
723 state->tv.margins.left = val;
725 state->tv.margins.right = val;
727 state->tv.margins.top = val;
729 state->tv.margins.bottom = val;
731 state->tv.legacy_mode = val;
733 state->tv.mode = val;
735 state->tv.brightness = val;
737 state->tv.contrast = val;
739 state->tv.flicker_reduction = val;
741 state->tv.overscan = val;
743 state->tv.saturation = val;
745 state->tv.hue = val;
752 * restore the state it wants on VT switch. So if the userspace
756 * state.
758 if (state->link_status != DRM_LINK_STATUS_GOOD)
759 state->link_status = val;
762 &state->hdr_output_metadata,
768 state->picture_aspect_ratio = val;
770 state->content_type = val;
772 state->scaling_mode = val;
778 state->content_protection = val;
780 state->hdcp_content_type = val;
782 state->colorspace = val;
788 ret = drm_atomic_set_writeback_fb_for_connector(state, fb);
795 return set_out_fence_for_connector(state->state, connector,
798 state->max_requested_bpc = val;
800 state->privacy_screen_sw_state = val;
803 state, property, val);
817 const struct drm_connector_state *state,
824 *val = (state->crtc) ? state->crtc->base.id : 0;
826 if (state->crtc && state->crtc->state->self_refresh_active)
831 *val = state->tv.select_subconnector;
833 *val = state->tv.subconnector;
835 *val = state->tv.margins.left;
837 *val = state->tv.margins.right;
839 *val = state->tv.margins.top;
841 *val = state->tv.margins.bottom;
843 *val = state->tv.legacy_mode;
845 *val = state->tv.mode;
847 *val = state->tv.brightness;
849 *val = state->tv.contrast;
851 *val = state->tv.flicker_reduction;
853 *val = state->tv.overscan;
855 *val = state->tv.saturation;
857 *val = state->tv.hue;
859 *val = state->link_status;
861 *val = state->picture_aspect_ratio;
863 *val = state->content_type;
865 *val = state->colorspace;
867 *val = state->scaling_mode;
869 *val = state->hdr_output_metadata ?
870 state->hdr_output_metadata->base.id : 0;
872 *val = state->content_protection;
874 *val = state->hdcp_content_type;
881 *val = state->max_requested_bpc;
883 *val = state->privacy_screen_sw_state;
886 state, property, val);
910 connector->state, property, val);
918 crtc->state, property, val);
926 plane->state, property, val);
959 int drm_atomic_connector_commit_dpms(struct drm_atomic_state *state,
970 ret = drm_modeset_lock(&state->dev->mode_config.connection_mutex,
971 state->acquire_ctx);
979 crtc = connector->state->crtc;
982 ret = drm_atomic_add_affected_connectors(state, crtc);
986 crtc_state = drm_atomic_get_crtc_state(state, crtc);
992 for_each_new_connector_in_state(state, tmp_connector, new_conn_state, i) {
1002 ret = drm_atomic_commit(state);
1009 int drm_atomic_set_property(struct drm_atomic_state *state,
1026 connector_state = drm_atomic_get_connector_state(state, connector);
1041 crtc_state = drm_atomic_get_crtc_state(state, crtc);
1055 plane_state = drm_atomic_get_plane_state(state, plane);
1152 struct drm_atomic_state *state,
1167 for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
1170 fence_ptr = get_out_fence_for_crtc(crtc_state->state, crtc);
1227 for_each_new_connector_in_state(state, conn, conn_state, i) {
1236 fence_ptr = get_out_fence_for_connector(state, conn);
1277 struct drm_atomic_state *state,
1295 for_each_new_crtc_in_state(state, crtc, crtc_state, i) {
1335 struct drm_atomic_state *state;
1379 state = drm_atomic_state_alloc(dev);
1380 if (!state)
1384 state->acquire_ctx = &ctx;
1385 state->allow_modeset = !!(arg->flags & DRM_MODE_ATOMIC_ALLOW_MODESET);
1453 ret = drm_atomic_set_property(state, file_priv,
1466 ret = prepare_signaling(dev, state, arg, file_priv, &fence_state,
1472 ret = drm_atomic_check_only(state);
1474 ret = drm_atomic_nonblocking_commit(state);
1476 ret = drm_atomic_commit(state);
1480 complete_signaling(dev, state, fence_state, num_fences, !ret);
1483 drm_atomic_state_clear(state);
1489 drm_atomic_state_put(state);