Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293793
b: refs/heads/master
c: c3c50e8
h: refs/heads/master
i:
  293791: abaad28
v: v3
  • Loading branch information
Ville Syrjälä authored and Dave Airlie committed Mar 15, 2012
1 parent 629dd5d commit ea08838
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d63f5e6bf6f2a1573ea39c9937cdf5ab0b3a4b77
refs/heads/master: c3c50e8b651887bcefcc13beb3739c00b2379b5c
28 changes: 23 additions & 5 deletions trunk/drivers/gpu/drm/drm_modes.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,6 +713,27 @@ void drm_mode_set_crtcinfo(struct drm_display_mode *p, int adjust_flags)
EXPORT_SYMBOL(drm_mode_set_crtcinfo);


/**
* drm_mode_copy - copy the mode
* @dst: mode to overwrite
* @src: mode to copy
*
* LOCKING:
* None.
*
* Copy an existing mode into another mode, preserving the object id
* of the destination mode.
*/
void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src)
{
int id = dst->base.id;

*dst = *src;
dst->base.id = id;
INIT_LIST_HEAD(&dst->head);
}
EXPORT_SYMBOL(drm_mode_copy);

/**
* drm_mode_duplicate - allocate and duplicate an existing mode
* @m: mode to duplicate
Expand All @@ -727,16 +748,13 @@ struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
const struct drm_display_mode *mode)
{
struct drm_display_mode *nmode;
int new_id;

nmode = drm_mode_create(dev);
if (!nmode)
return NULL;

new_id = nmode->base.id;
*nmode = *mode;
nmode->base.id = new_id;
INIT_LIST_HEAD(&nmode->head);
drm_mode_copy(nmode, mode);

return nmode;
}
EXPORT_SYMBOL(drm_mode_duplicate);
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/gpu/drm/nouveau/nv50_dac.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,8 @@ nv50_dac_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
}

if (connector->scaling_mode != DRM_MODE_SCALE_NONE &&
connector->native_mode) {
int id = adjusted_mode->base.id;
*adjusted_mode = *connector->native_mode;
adjusted_mode->base.id = id;
}
connector->native_mode)
drm_mode_copy(adjusted_mode, connector->native_mode);

return true;
}
Expand Down
7 changes: 2 additions & 5 deletions trunk/drivers/gpu/drm/nouveau/nv50_sor.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,11 +342,8 @@ nv50_sor_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
}

if (connector->scaling_mode != DRM_MODE_SCALE_NONE &&
connector->native_mode) {
int id = adjusted_mode->base.id;
*adjusted_mode = *connector->native_mode;
adjusted_mode->base.id = id;
}
connector->native_mode)
drm_mode_copy(adjusted_mode, connector->native_mode);

return true;
}
Expand Down
1 change: 1 addition & 0 deletions trunk/include/drm/drm_crtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -855,6 +855,7 @@ extern struct edid *drm_get_edid(struct drm_connector *connector,
extern int drm_add_edid_modes(struct drm_connector *connector, struct edid *edid);
extern void drm_mode_probed_add(struct drm_connector *connector, struct drm_display_mode *mode);
extern void drm_mode_remove(struct drm_connector *connector, struct drm_display_mode *mode);
extern void drm_mode_copy(struct drm_display_mode *dst, const struct drm_display_mode *src);
extern struct drm_display_mode *drm_mode_duplicate(struct drm_device *dev,
const struct drm_display_mode *mode);
extern void drm_mode_debug_printmodeline(struct drm_display_mode *mode);
Expand Down

0 comments on commit ea08838

Please sign in to comment.