On Thu, Nov 03, 2016 at 12:46:48PM -0700, Kristian Høgsberg wrote: > We used to call drm_of_encoder_active_endpoint_id() from > rockchip_dp_drm_encoder_atomic_check() to determine the endpoint for the > active encoder. However, the encoder isn't necessarily active at this > point or it may be connected to different crtc than what we're switching > to. Instead, look at the crtc from the drm_crtc_state. This fixes wrong > colors when driving the eDP with the big VOP. Further, we can identify > the type of VOP we're dealing with by just putting a VOP id enum in the > vop_data. > > On way to test this is to use the modetest tool from libdrm: > > $ modetest -M rockchip -s 32@28:2400x1600 > > which displays dark or black colors because we fail to look up the > endpoint and use default 0 (which is ROCKCHIP_OUT_MODE_P888) for big > VOP instead of RGB10 as required. > > For reference, > > $ modetest -M rockchip -s 32@25:2400x1600 > > drives the eDP from little VOP and displays correctly. > > Signed-off-by: Kristian H. Kristensen <hoegsberg@xxxxxxxxxxxx> > --- > v2: Stripped chromeos annotations, fix compile errors for drivers I didn't > compile when I first wrote the patch. > [ ... ] > > +enum vop_id vop_get_crtc_vop_id(struct drm_crtc *crtc) > +{ > + struct vop *vop = to_vop(crtc); > + > + return vop->data->id; > +} Missing EXPORT() causes build errors if calling code is built as module. Example arm64:allmodconfig: ERROR: "vop_get_crtc_vop_id" [drivers/gpu/drm/rockchip/dw-mipi-dsi.ko] undefined! ERROR: "vop_get_crtc_vop_id" [drivers/gpu/drm/rockchip/cdn-dp.ko] undefined! ERROR: "vop_get_crtc_vop_id" [drivers/gpu/drm/rockchip/analogix_dp-rockchip.ko] undefined! Guenter _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel