Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 242323
b: refs/heads/master
c: 2d370f5
h: refs/heads/master
i:
  242321: 193cc8b
  242319: b3f088f
v: v3
  • Loading branch information
Dave Airlie committed Mar 24, 2011
1 parent fa5fa3a commit e826e01
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 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: f0c860246472248a534656d6cdbed5a36d1feb2e
refs/heads/master: 2d370f502ac872dc9b4cd05f9922b260e2874ec1
51 changes: 51 additions & 0 deletions trunk/drivers/gpu/drm/drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,9 @@ int drm_mode_getresources(struct drm_device *dev, void *data,
uint32_t __user *encoder_id;
struct drm_mode_group *mode_group;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);

/*
Expand Down Expand Up @@ -1244,6 +1247,9 @@ int drm_mode_getcrtc(struct drm_device *dev,
struct drm_mode_object *obj;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);

obj = drm_mode_object_find(dev, crtc_resp->crtc_id,
Expand Down Expand Up @@ -1312,6 +1318,9 @@ int drm_mode_getconnector(struct drm_device *dev, void *data,
uint64_t __user *prop_values;
uint32_t __user *encoder_ptr;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

memset(&u_mode, 0, sizeof(struct drm_mode_modeinfo));

DRM_DEBUG_KMS("[CONNECTOR:%d:?]\n", out_resp->connector_id);
Expand Down Expand Up @@ -1431,6 +1440,9 @@ int drm_mode_getencoder(struct drm_device *dev, void *data,
struct drm_encoder *encoder;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, enc_resp->encoder_id,
DRM_MODE_OBJECT_ENCODER);
Expand Down Expand Up @@ -1486,6 +1498,9 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data,
int ret = 0;
int i;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_req->crtc_id,
DRM_MODE_OBJECT_CRTC);
Expand Down Expand Up @@ -1603,6 +1618,9 @@ int drm_mode_cursor_ioctl(struct drm_device *dev,
struct drm_crtc *crtc;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

if (!req->flags) {
DRM_ERROR("no operation set\n");
return -EINVAL;
Expand Down Expand Up @@ -1667,6 +1685,9 @@ int drm_mode_addfb(struct drm_device *dev,
struct drm_framebuffer *fb;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

if ((config->min_width > r->width) || (r->width > config->max_width)) {
DRM_ERROR("mode new framebuffer width not within limits\n");
return -EINVAL;
Expand Down Expand Up @@ -1724,6 +1745,9 @@ int drm_mode_rmfb(struct drm_device *dev,
int ret = 0;
int found = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, *id, DRM_MODE_OBJECT_FB);
/* TODO check that we realy get a framebuffer back. */
Expand Down Expand Up @@ -1780,6 +1804,9 @@ int drm_mode_getfb(struct drm_device *dev,
struct drm_framebuffer *fb;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) {
Expand Down Expand Up @@ -1813,6 +1840,9 @@ int drm_mode_dirtyfb_ioctl(struct drm_device *dev,
int num_clips;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, r->fb_id, DRM_MODE_OBJECT_FB);
if (!obj) {
Expand Down Expand Up @@ -1996,6 +2026,9 @@ int drm_mode_attachmode_ioctl(struct drm_device *dev,
struct drm_mode_modeinfo *umode = &mode_cmd->mode;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);

obj = drm_mode_object_find(dev, mode_cmd->connector_id, DRM_MODE_OBJECT_CONNECTOR);
Expand Down Expand Up @@ -2042,6 +2075,9 @@ int drm_mode_detachmode_ioctl(struct drm_device *dev,
struct drm_mode_modeinfo *umode = &mode_cmd->mode;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);

obj = drm_mode_object_find(dev, mode_cmd->connector_id, DRM_MODE_OBJECT_CONNECTOR);
Expand Down Expand Up @@ -2211,6 +2247,9 @@ int drm_mode_getproperty_ioctl(struct drm_device *dev,
uint64_t __user *values_ptr;
uint32_t __user *blob_length_ptr;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, out_resp->prop_id, DRM_MODE_OBJECT_PROPERTY);
if (!obj) {
Expand Down Expand Up @@ -2333,6 +2372,9 @@ int drm_mode_getblob_ioctl(struct drm_device *dev,
int ret = 0;
void *blob_ptr;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, out_resp->blob_id, DRM_MODE_OBJECT_BLOB);
if (!obj) {
Expand Down Expand Up @@ -2393,6 +2435,9 @@ int drm_mode_connector_property_set_ioctl(struct drm_device *dev,
int ret = -EINVAL;
int i;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);

obj = drm_mode_object_find(dev, out_resp->connector_id, DRM_MODE_OBJECT_CONNECTOR);
Expand Down Expand Up @@ -2509,6 +2554,9 @@ int drm_mode_gamma_set_ioctl(struct drm_device *dev,
int size;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_lut->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj) {
Expand Down Expand Up @@ -2560,6 +2608,9 @@ int drm_mode_gamma_get_ioctl(struct drm_device *dev,
int size;
int ret = 0;

if (!drm_core_check_feature(dev, DRIVER_MODESET))
return -EINVAL;

mutex_lock(&dev->mode_config.mutex);
obj = drm_mode_object_find(dev, crtc_lut->crtc_id, DRM_MODE_OBJECT_CRTC);
if (!obj) {
Expand Down
6 changes: 5 additions & 1 deletion trunk/drivers/gpu/drm/radeon/atombios_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -957,7 +957,11 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
/* adjust pixel clock as needed */
adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss);

if (ASIC_IS_AVIVO(rdev))
if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
/* TV seems to prefer the legacy algo on some boards */
radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
&ref_div, &post_div);
else if (ASIC_IS_AVIVO(rdev))
radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
&ref_div, &post_div);
else
Expand Down

0 comments on commit e826e01

Please sign in to comment.