Skip to content

Commit

Permalink
Merge branch 'topic/core-stuff' of git://git.freedesktop.org/git/drm-…
Browse files Browse the repository at this point in the history
…intel into drm-next

Merge straggling core drm patches.

* 'topic/core-stuff' of git://git.freedesktop.org/git/drm-intel:
  drm: Fix use-after-free in the shadow-attache exit code
  drm/fb-helper: Do the 'max_conn_count' zero check
  drm: Check if the allocation has succeeded before dereferencing newmode
  drm/fb-helper: Use drm_fb_helper_restore_fbdev_mode() in drm_fb_helper_set_par()
  drm/edid: request HDMI underscan by default
  • Loading branch information
Dave Airlie committed Mar 18, 2014
2 parents 7550e36 + c94adc4 commit 5a08c07
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 10 deletions.
4 changes: 4 additions & 0 deletions drivers/gpu/drm/drm_edid.c
Original file line number Diff line number Diff line change
Expand Up @@ -2590,6 +2590,9 @@ drm_display_mode_from_vic_index(struct drm_connector *connector,
return NULL;

newmode = drm_mode_duplicate(dev, &edid_cea_modes[cea_mode]);
if (!newmode)
return NULL;

newmode->vrefresh = 0;

return newmode;
Expand Down Expand Up @@ -3611,6 +3614,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,

frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN;

return 0;
}
Expand Down
13 changes: 4 additions & 9 deletions drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,6 +516,9 @@ int drm_fb_helper_init(struct drm_device *dev,
struct drm_crtc *crtc;
int i;

if (!max_conn_count)
return -EINVAL;

fb_helper->dev = dev;

INIT_LIST_HEAD(&fb_helper->kernel_fb_list);
Expand Down Expand Up @@ -809,22 +812,14 @@ int drm_fb_helper_set_par(struct fb_info *info)
struct drm_fb_helper *fb_helper = info->par;
struct drm_device *dev = fb_helper->dev;
struct fb_var_screeninfo *var = &info->var;
int ret;
int i;

if (var->pixclock != 0) {
DRM_ERROR("PIXEL CLOCK SET\n");
return -EINVAL;
}

drm_modeset_lock_all(dev);
for (i = 0; i < fb_helper->crtc_count; i++) {
ret = drm_mode_set_config_internal(&fb_helper->crtc_info[i].mode_set);
if (ret) {
drm_modeset_unlock_all(dev);
return ret;
}
}
drm_fb_helper_restore_fbdev_mode(fb_helper);
drm_modeset_unlock_all(dev);

if (fb_helper->delayed_hotplug) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/drm_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,8 +468,8 @@ void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
} else {
list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
legacy_dev_list) {
drm_put_dev(dev);
list_del(&dev->legacy_dev_list);
drm_put_dev(dev);
}
}
DRM_INFO("Module unloaded\n");
Expand Down

0 comments on commit 5a08c07

Please sign in to comment.