Skip to content

Commit

Permalink
drm/nouveau: use helpers
Browse files Browse the repository at this point in the history
Signed-off-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
  • Loading branch information
Rob Clark authored and Dave Airlie committed Jul 18, 2014
1 parent a4cd5d6 commit 6d385c0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions drivers/gpu/drm/nouveau/nouveau_connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,18 @@ find_encoder(struct drm_connector *connector, int type)
{
struct drm_device *dev = connector->dev;
struct nouveau_encoder *nv_encoder;
struct drm_mode_object *obj;
struct drm_encoder *enc;
int i, id;

for (i = 0; i < DRM_CONNECTOR_MAX_ENCODER; i++) {
id = connector->encoder_ids[i];
if (!id)
break;

obj = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_ENCODER);
if (!obj)
enc = drm_encoder_find(dev, id);
if (!enc)
continue;
nv_encoder = nouveau_encoder(obj_to_encoder(obj));
nv_encoder = nouveau_encoder(enc);

if (type == DCB_OUTPUT_ANY ||
(nv_encoder->dcb && nv_encoder->dcb->type == type))
Expand Down Expand Up @@ -119,7 +119,7 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)
struct nouveau_drm *drm = nouveau_drm(dev);
struct nouveau_gpio *gpio = nouveau_gpio(drm->device);
struct nouveau_encoder *nv_encoder;
struct drm_mode_object *obj;
struct drm_encoder *encoder;
int i, panel = -ENODEV;

/* eDP panels need powering on by us (if the VBIOS doesn't default it
Expand All @@ -139,10 +139,10 @@ nouveau_connector_ddc_detect(struct drm_connector *connector)
if (id == 0)
break;

obj = drm_mode_object_find(dev, id, DRM_MODE_OBJECT_ENCODER);
if (!obj)
encoder = drm_encoder_find(dev, id);
if (!encoder)
continue;
nv_encoder = nouveau_encoder(obj_to_encoder(obj));
nv_encoder = nouveau_encoder(encoder);

if (nv_encoder->dcb->type == DCB_OUTPUT_DP) {
int ret = nouveau_dp_detect(nv_encoder);
Expand Down

0 comments on commit 6d385c0

Please sign in to comment.