On Wed, Dec 11, 2013 at 4:48 PM, Matt Roper matthew.d.roper@intel.com wrote:
On Mon, Nov 25, 2013 at 09:47:34AM -0500, Rob Clark wrote: ...
+static struct drm_crtc_state * +drm_atomic_helper_get_crtc_state(struct drm_crtc *crtc, void *state) +{
struct drm_atomic_helper_state *a = state;
struct drm_crtc_state *cstate;
int ret;
ret = drm_modeset_lock(&crtc->mutex, state);
if (ret)
return ERR_PTR(ret);
cstate = a->cstates[crtc->id];
The id field of struct drm_crtc never seems to be initialized in the current DRM codebase, so this will always wind up looking up cstates[0]; we probably want to initialize crtc->id in drm_crtc_init() at the same place we increment dev->mode_config.num_crtc.
yeah, it is supposed to be initialized in drm_crtc_init().. I was juggling the patches around a bit, possibly I screwed up and that ended up in one of the later patches?
I'll go back and check this
...
+static int check_connectors(struct drm_crtc *crtc, void *state, bool fix,
uint32_t *connector_ids, uint32_t num_connector_ids)
+{
struct drm_mode_config *config = &crtc->dev->mode_config;
struct drm_crtc *ocrtc; /* other connector */
list_for_each_entry(ocrtc, &config->crtc_list, head) {
struct drm_crtc_state *ostate; /* other state */
unsigned i;
if (ocrtc == crtc)
continue;
ostate = drm_atomic_get_crtc_state(crtc, state);
I think you meant to use ocrtc here rather than crtc, right?
yes, good catch. I need a driver with more than one connector to test with, apparently ;-)
I think you might also want to move patch 11 up above 9 & 10, otherwise you'll run into the lastclose deadlock while bisecting through this patchset.
good point.. that should be pretty easy to re-order
BR, -R
Matt
-- Matt Roper Intel Corporation