2 * Copyright 2007-8 Advanced Micro Devices, Inc.
3 * Copyright 2008 Red Hat Inc.
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
12 * The above copyright notice and this permission notice shall be included in
13 * all copies or substantial portions of the Software.
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
19 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
20 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
21 * OTHER DEALINGS IN THE SOFTWARE.
23 * Authors: Dave Airlie
27 #include "radeon_drm.h"
28 #include "radeon_drv.h"
31 #include <asm/div64.h>
33 #include "drm_crtc_helper.h"
36 int radeon_ddc_dump(struct drm_connector *connector);
40 static void avivo_crtc_load_lut(struct drm_crtc *crtc)
42 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
43 struct drm_device *dev = crtc->dev;
44 struct drm_radeon_private *dev_priv = dev->dev_private;
47 DRM_DEBUG("%d\n", radeon_crtc->crtc_id);
48 RADEON_WRITE(AVIVO_DC_LUTA_CONTROL + radeon_crtc->crtc_offset, 0);
50 RADEON_WRITE(AVIVO_DC_LUTA_BLACK_OFFSET_BLUE + radeon_crtc->crtc_offset, 0);
51 RADEON_WRITE(AVIVO_DC_LUTA_BLACK_OFFSET_GREEN + radeon_crtc->crtc_offset, 0);
52 RADEON_WRITE(AVIVO_DC_LUTA_BLACK_OFFSET_RED + radeon_crtc->crtc_offset, 0);
54 RADEON_WRITE(AVIVO_DC_LUTA_WHITE_OFFSET_BLUE + radeon_crtc->crtc_offset, 0xffff);
55 RADEON_WRITE(AVIVO_DC_LUTA_WHITE_OFFSET_GREEN + radeon_crtc->crtc_offset, 0xffff);
56 RADEON_WRITE(AVIVO_DC_LUTA_WHITE_OFFSET_RED + radeon_crtc->crtc_offset, 0xffff);
58 RADEON_WRITE(AVIVO_DC_LUT_RW_SELECT, radeon_crtc->crtc_id);
59 RADEON_WRITE(AVIVO_DC_LUT_RW_MODE, 0);
60 RADEON_WRITE(AVIVO_DC_LUT_WRITE_EN_MASK, 0x0000003f);
62 for (i = 0; i < 256; i++) {
63 RADEON_WRITE8(AVIVO_DC_LUT_RW_INDEX, i);
64 RADEON_WRITE(AVIVO_DC_LUT_30_COLOR,
65 (radeon_crtc->lut_r[i] << 22) |
66 (radeon_crtc->lut_g[i] << 12) |
67 (radeon_crtc->lut_b[i] << 2));
70 RADEON_WRITE(AVIVO_D1GRPH_LUT_SEL + radeon_crtc->crtc_offset, radeon_crtc->crtc_id);
73 static void legacy_crtc_load_lut(struct drm_crtc *crtc)
75 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
76 struct drm_device *dev = crtc->dev;
77 struct drm_radeon_private *dev_priv = dev->dev_private;
81 dac2_cntl = RADEON_READ(RADEON_DAC_CNTL2);
82 if (radeon_crtc->crtc_id == 0)
83 dac2_cntl &= (uint32_t)~RADEON_DAC2_PALETTE_ACC_CTL;
85 dac2_cntl |= RADEON_DAC2_PALETTE_ACC_CTL;
86 RADEON_WRITE(RADEON_DAC_CNTL2, dac2_cntl);
88 for (i = 0; i < 256; i++) {
89 RADEON_WRITE8(RADEON_PALETTE_INDEX, i);
90 RADEON_WRITE(RADEON_PALETTE_DATA,
91 (radeon_crtc->lut_r[i] << 16) |
92 (radeon_crtc->lut_g[i] << 8) |
93 (radeon_crtc->lut_b[i] << 0));
97 void radeon_crtc_load_lut(struct drm_crtc *crtc)
99 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
100 struct drm_device *dev = crtc->dev;
101 struct drm_radeon_private *dev_priv = dev->dev_private;
106 if (radeon_is_avivo(dev_priv))
107 avivo_crtc_load_lut(crtc);
109 legacy_crtc_load_lut(crtc);
112 /** Sets the color ramps on behalf of RandR */
113 void radeon_crtc_fb_gamma_set(struct drm_crtc *crtc, u16 red, u16 green,
116 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
119 DRM_DEBUG("gamma set %d\n", radeon_crtc->crtc_id);
120 radeon_crtc->lut_r[regno] = red >> 8;
121 radeon_crtc->lut_g[regno] = green >> 8;
122 radeon_crtc->lut_b[regno] = blue >> 8;
125 static void radeon_crtc_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green,
126 u16 *blue, uint32_t size)
128 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
134 if (crtc->fb->depth == 16) {
135 for (i = 0; i < 64; i++) {
137 for (j = 0; j < 8; j++) {
138 radeon_crtc->lut_r[i * 8 + j] = red[i] >> 8;
139 radeon_crtc->lut_b[i * 8 + j] = blue[i] >> 8;
142 for (j = 0; j < 4; j++)
143 radeon_crtc->lut_g[i * 4 + j] = green[i] >> 8;
146 for (i = 0; i < 256; i++) {
147 radeon_crtc->lut_r[i] = red[i] >> 8;
148 radeon_crtc->lut_g[i] = green[i] >> 8;
149 radeon_crtc->lut_b[i] = blue[i] >> 8;
153 radeon_crtc_load_lut(crtc);
156 static void radeon_crtc_destroy(struct drm_crtc *crtc)
158 struct radeon_crtc *radeon_crtc = to_radeon_crtc(crtc);
160 drm_crtc_cleanup(crtc);
164 static const struct drm_crtc_funcs radeon_crtc_funcs = {
165 .cursor_set = radeon_crtc_cursor_set,
166 .cursor_move = radeon_crtc_cursor_move,
167 .gamma_set = radeon_crtc_gamma_set,
168 .set_config = drm_crtc_helper_set_config,
169 .destroy = radeon_crtc_destroy,
172 static void radeon_crtc_init(struct drm_device *dev, int index)
174 struct drm_radeon_private *dev_priv = dev->dev_private;
175 struct radeon_crtc *radeon_crtc;
178 radeon_crtc = kzalloc(sizeof(struct radeon_crtc) + (RADEONFB_CONN_LIMIT * sizeof(struct drm_connector *)), GFP_KERNEL);
179 // radeon_crtc = kzalloc(sizeof(struct radeon_crtc), GFP_KERNEL);
180 if (radeon_crtc == NULL)
183 drm_crtc_init(dev, &radeon_crtc->base, &radeon_crtc_funcs);
185 drm_mode_crtc_set_gamma_size(&radeon_crtc->base, 256);
186 radeon_crtc->crtc_id = index;
188 radeon_crtc->mode_set.crtc = &radeon_crtc->base;
189 radeon_crtc->mode_set.connectors = (struct drm_connector **)(radeon_crtc + 1);
190 radeon_crtc->mode_set.num_connectors = 0;
192 for (i = 0; i < 256; i++) {
193 radeon_crtc->lut_r[i] = i;
194 radeon_crtc->lut_g[i] = i;
195 radeon_crtc->lut_b[i] = i;
198 if (dev_priv->is_atom_bios && radeon_is_avivo(dev_priv))
199 radeon_atombios_init_crtc(dev, radeon_crtc);
201 radeon_legacy_init_crtc(dev, radeon_crtc);
204 bool radeon_legacy_setup_enc_conn(struct drm_device *dev)
207 radeon_get_legacy_connector_info_from_bios(dev);
211 bool radeon_setup_enc_conn(struct drm_device *dev)
213 struct drm_radeon_private *dev_priv = dev->dev_private;
214 struct radeon_mode_info *mode_info = &dev_priv->mode_info;
215 /* do all the mac and stuff */
216 struct drm_connector *connector;
217 struct drm_encoder *encoder;
220 if (dev_priv->is_atom_bios)
221 radeon_get_atom_connector_info_from_bios_connector_table(dev);
223 radeon_get_legacy_connector_info_from_bios(dev);
225 for (i = 0; i < RADEON_MAX_BIOS_CONNECTOR; i++) {
226 if (!mode_info->bios_connector[i].valid)
229 /* add a connector for this */
230 if (mode_info->bios_connector[i].connector_type == CONNECTOR_NONE)
233 connector = radeon_connector_add(dev, i);
238 /* if we find an LVDS connector */
239 if (mode_info->bios_connector[i].connector_type == CONNECTOR_LVDS) {
240 if (radeon_is_avivo(dev_priv))
241 encoder = radeon_encoder_lvtma_add(dev, i);
243 encoder = radeon_encoder_legacy_lvds_add(dev, i);
245 drm_mode_connector_attach_encoder(connector, encoder);
248 /* DAC on DVI or VGA */
249 if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) ||
250 (mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_A) ||
251 (mode_info->bios_connector[i].connector_type == CONNECTOR_VGA)) {
252 if (radeon_is_avivo(dev_priv)) {
253 encoder = radeon_encoder_atom_dac_add(dev, i, mode_info->bios_connector[i].dac_type, 0);
255 if (mode_info->bios_connector[i].dac_type == DAC_PRIMARY)
256 encoder = radeon_encoder_legacy_primary_dac_add(dev, i, 0);
257 else if (mode_info->bios_connector[i].dac_type == DAC_TVDAC)
258 encoder = radeon_encoder_legacy_tv_dac_add(dev, i, 0);
261 drm_mode_connector_attach_encoder(connector, encoder);
265 if ((mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_I) ||
266 (mode_info->bios_connector[i].connector_type == CONNECTOR_DVI_D)) {
267 if (radeon_is_avivo(dev_priv))
268 encoder = radeon_encoder_atom_tmds_add(dev, i, mode_info->bios_connector[i].tmds_type);
270 if (mode_info->bios_connector[i].tmds_type == TMDS_INT)
271 encoder = radeon_encoder_legacy_tmds_int_add(dev, i);
272 else if (mode_info->bios_connector[i].dac_type == TMDS_EXT)
273 encoder = radeon_encoder_legacy_tmds_ext_add(dev, i);
276 drm_mode_connector_attach_encoder(connector, encoder);
280 if (mode_info->bios_connector[i].connector_type == CONNECTOR_DIN) {
281 if (radeon_is_avivo(dev_priv))
282 encoder = radeon_encoder_atom_dac_add(dev, i, mode_info->bios_connector[i].dac_type, 1);
284 if (mode_info->bios_connector[i].dac_type == DAC_TVDAC)
285 encoder = radeon_encoder_legacy_tv_dac_add(dev, i, 0);
288 drm_mode_connector_attach_encoder(connector, encoder);
292 list_for_each_entry(connector, &dev->mode_config.connector_list, head)
293 radeon_ddc_dump(connector);
297 int radeon_ddc_get_modes(struct radeon_connector *radeon_connector)
299 struct drm_radeon_private *dev_priv = radeon_connector->base.dev->dev_private;
303 if (!radeon_connector->ddc_bus)
305 radeon_i2c_do_lock(radeon_connector, 1);
306 edid = drm_get_edid(&radeon_connector->base, &radeon_connector->ddc_bus->adapter);
307 radeon_i2c_do_lock(radeon_connector, 0);
309 /* update digital bits here */
311 radeon_connector->use_digital = 1;
313 radeon_connector->use_digital = 0;
314 drm_mode_connector_update_edid_property(&radeon_connector->base, edid);
315 ret = drm_add_edid_modes(&radeon_connector->base, edid);
322 int radeon_ddc_dump(struct drm_connector *connector)
325 struct radeon_connector *radeon_connector = to_radeon_connector(connector);
328 if (!radeon_connector->ddc_bus)
330 radeon_i2c_do_lock(radeon_connector, 1);
331 edid = drm_get_edid(connector, &radeon_connector->ddc_bus->adapter);
332 radeon_i2c_do_lock(radeon_connector, 0);
339 static inline uint32_t radeon_div(uint64_t n, uint32_t d)
341 uint64_t x, y, result;
350 void radeon_compute_pll(struct radeon_pll *pll,
352 uint32_t *dot_clock_p,
355 uint32_t *post_div_p,
358 uint32_t min_ref_div = pll->min_ref_div;
359 uint32_t max_ref_div = pll->max_ref_div;
360 uint32_t best_vco = pll->best_vco;
361 uint32_t best_post_div = 1;
362 uint32_t best_ref_div = 1;
363 uint32_t best_feedback_div = 1;
364 uint32_t best_freq = -1;
365 uint32_t best_error = 0xffffffff;
366 uint32_t best_vco_diff = 1;
369 DRM_DEBUG("PLL freq %llu\n", freq);
372 if (flags & RADEON_PLL_USE_REF_DIV)
373 min_ref_div = max_ref_div = pll->reference_div;
375 while (min_ref_div < max_ref_div-1) {
376 uint32_t mid=(min_ref_div+max_ref_div)/2;
377 uint32_t pll_in = pll->reference_freq / mid;
378 if (pll_in < pll->pll_in_min)
380 else if (pll_in > pll->pll_in_max)
387 for (post_div = pll->min_post_div; post_div <= pll->max_post_div; ++post_div) {
390 if ((flags & RADEON_PLL_NO_ODD_POST_DIV) && (post_div & 1))
393 /* legacy radeons only have a few post_divs */
394 if (flags & RADEON_PLL_LEGACY) {
395 if ((post_div == 5) ||
406 for (ref_div = min_ref_div; ref_div <= max_ref_div; ++ref_div) {
407 uint32_t feedback_div, current_freq, error, vco_diff;
408 uint32_t pll_in = pll->reference_freq / ref_div;
409 uint32_t min_feed_div = pll->min_feedback_div;
410 uint32_t max_feed_div = pll->max_feedback_div+1;
412 if (pll_in < pll->pll_in_min || pll_in > pll->pll_in_max)
415 while (min_feed_div < max_feed_div) {
417 feedback_div = (min_feed_div+max_feed_div)/2;
419 vco = radeon_div((uint64_t)pll->reference_freq * feedback_div,
422 if (vco < pll->pll_out_min) {
423 min_feed_div = feedback_div+1;
425 } else if(vco > pll->pll_out_max) {
426 max_feed_div = feedback_div;
430 current_freq = radeon_div((uint64_t)pll->reference_freq * 10000 * feedback_div,
433 error = abs(current_freq - freq);
434 vco_diff = abs(vco - best_vco);
436 if ((best_vco == 0 && error < best_error) ||
438 (error < best_error - 100 ||
439 (abs(error - best_error) < 100 && vco_diff < best_vco_diff )))) {
440 best_post_div = post_div;
441 best_ref_div = ref_div;
442 best_feedback_div = feedback_div;
443 best_freq = current_freq;
445 best_vco_diff = vco_diff;
446 } else if (current_freq == freq) {
447 if (best_freq == -1) {
448 best_post_div = post_div;
449 best_ref_div = ref_div;
450 best_feedback_div = feedback_div;
451 best_freq = current_freq;
453 best_vco_diff = vco_diff;
454 } else if (((flags & RADEON_PLL_PREFER_LOW_REF_DIV) && (ref_div < best_ref_div)) ||
455 ((flags & RADEON_PLL_PREFER_HIGH_REF_DIV) && (ref_div > best_ref_div)) ||
456 ((flags & RADEON_PLL_PREFER_LOW_FB_DIV) && (feedback_div < best_feedback_div)) ||
457 ((flags & RADEON_PLL_PREFER_HIGH_FB_DIV) && (feedback_div > best_feedback_div)) ||
458 ((flags & RADEON_PLL_PREFER_LOW_POST_DIV) && (post_div < best_post_div)) ||
459 ((flags & RADEON_PLL_PREFER_HIGH_POST_DIV) && (post_div > best_post_div))) {
460 best_post_div = post_div;
461 best_ref_div = ref_div;
462 best_feedback_div = feedback_div;
463 best_freq = current_freq;
465 best_vco_diff = vco_diff;
469 if (current_freq < freq)
470 min_feed_div = feedback_div+1;
472 max_feed_div = feedback_div;
477 *dot_clock_p = best_freq / 10000;
478 *fb_div_p = best_feedback_div;
479 *ref_div_p = best_ref_div;
480 *post_div_p = best_post_div;
483 void radeon_get_clock_info(struct drm_device *dev)
485 drm_radeon_private_t *dev_priv = dev->dev_private;
486 struct radeon_pll *p1pll = &dev_priv->mode_info.p1pll;
487 struct radeon_pll *p2pll = &dev_priv->mode_info.p2pll;
488 struct radeon_pll *spll = &dev_priv->mode_info.spll;
489 struct radeon_pll *mpll = &dev_priv->mode_info.mpll;
492 if (dev_priv->is_atom_bios)
493 ret = radeon_atom_get_clock_info(dev);
495 ret = radeon_combios_get_clock_info(dev);
498 if (p1pll->reference_div < 2)
499 p1pll->reference_div = 12;
500 if (p2pll->reference_div < 2)
501 p2pll->reference_div = 12;
507 if (radeon_is_avivo(dev_priv)) {
508 p1pll->min_post_div = 2;
509 p1pll->max_post_div = 0x7f;
510 p2pll->min_post_div = 2;
511 p2pll->max_post_div = 0x7f;
513 p1pll->min_post_div = 1;
514 p1pll->max_post_div = 16;
515 p2pll->min_post_div = 1;
516 p2pll->max_post_div = 12;
519 p1pll->min_ref_div = 2;
520 p1pll->max_ref_div = 0x3ff;
521 p1pll->min_feedback_div = 4;
522 p1pll->max_feedback_div = 0x7ff;
525 p2pll->min_ref_div = 2;
526 p2pll->max_ref_div = 0x3ff;
527 p2pll->min_feedback_div = 4;
528 p2pll->max_feedback_div = 0x7ff;
532 spll->min_post_div = 1;
533 spll->max_post_div = 1;
534 spll->min_ref_div = 2;
535 spll->max_ref_div = 0xff;
536 spll->min_feedback_div = 4;
537 spll->max_feedback_div = 0xff;
541 mpll->min_post_div = 1;
542 mpll->max_post_div = 1;
543 mpll->min_ref_div = 2;
544 mpll->max_ref_div = 0xff;
545 mpll->min_feedback_div = 4;
546 mpll->max_feedback_div = 0xff;
551 /* not sure of the best place for these */
553 void radeon_legacy_set_engine_clock(struct drm_device *dev, int eng_clock)
555 struct drm_radeon_private *dev_priv = dev->dev_private;
556 struct radeon_mode_info *mode_info = &dev_priv->mode_info;
557 struct radeon_pll *spll = &mode_info->spll;
558 uint32_t ref_div, fb_div;
559 uint32_t m_spll_ref_fb_div;
561 /* FIXME wait for idle */
563 m_spll_ref_fb_div = RADEON_READ_PLL(dev_priv, RADEON_M_SPLL_REF_FB_DIV);
564 m_spll_ref_fb_div &= ((RADEON_M_SPLL_REF_DIV_MASK << RADEON_M_SPLL_REF_DIV_SHIFT) |
565 (RADEON_MPLL_FB_DIV_MASK << RADEON_MPLL_FB_DIV_SHIFT));
566 ref_div = m_spll_ref_fb_div & RADEON_M_SPLL_REF_DIV_MASK;
568 fb_div = radeon_div(eng_clock * ref_div, spll->reference_freq);
569 m_spll_ref_fb_div |= (fb_div & RADEON_SPLL_FB_DIV_MASK) << RADEON_SPLL_FB_DIV_SHIFT;
570 RADEON_WRITE_PLL(dev_priv, RADEON_M_SPLL_REF_FB_DIV, m_spll_ref_fb_div);
575 void radeon_legacy_set_memory_clock(struct drm_device *dev, int mem_clock)
577 struct drm_radeon_private *dev_priv = dev->dev_private;
578 struct radeon_mode_info *mode_info = &dev_priv->mode_info;
579 struct radeon_pll *mpll = &mode_info->mpll;
580 uint32_t ref_div, fb_div;
581 uint32_t m_spll_ref_fb_div;
583 /* FIXME wait for idle */
585 m_spll_ref_fb_div = RADEON_READ_PLL(dev_priv, RADEON_M_SPLL_REF_FB_DIV);
586 m_spll_ref_fb_div &= ((RADEON_M_SPLL_REF_DIV_MASK << RADEON_M_SPLL_REF_DIV_SHIFT) |
587 (RADEON_SPLL_FB_DIV_MASK << RADEON_SPLL_FB_DIV_SHIFT));
588 ref_div = m_spll_ref_fb_div & RADEON_M_SPLL_REF_DIV_MASK;
590 fb_div = radeon_div(mem_clock * ref_div, mpll->reference_freq);
591 m_spll_ref_fb_div |= (fb_div & RADEON_MPLL_FB_DIV_MASK) << RADEON_MPLL_FB_DIV_SHIFT;
592 RADEON_WRITE_PLL(dev_priv, RADEON_M_SPLL_REF_FB_DIV, m_spll_ref_fb_div);
596 static void radeon_user_framebuffer_destroy(struct drm_framebuffer *fb)
598 struct radeon_framebuffer *radeon_fb = to_radeon_framebuffer(fb);
599 struct drm_device *dev = fb->dev;
602 radeonfb_remove(dev, fb);
604 drm_framebuffer_cleanup(fb);
608 static const struct drm_framebuffer_funcs radeon_fb_funcs = {
609 .destroy = radeon_user_framebuffer_destroy,
612 struct drm_framebuffer *radeon_user_framebuffer_create(struct drm_device *dev,
613 struct drm_file *filp,
614 struct drm_mode_fb_cmd *mode_cmd)
617 struct radeon_framebuffer *radeon_fb;
619 radeon_fb = kzalloc(sizeof(*radeon_fb), GFP_KERNEL);
623 drm_framebuffer_init(dev, &radeon_fb->base, &radeon_fb_funcs);
624 drm_helper_mode_fill_fb_struct(&radeon_fb->base, mode_cmd);
627 radeon_fb->obj = drm_gem_object_lookup(dev, filp,
629 if (!radeon_fb->obj) {
633 drm_gem_object_unreference(radeon_fb->obj);
635 return &radeon_fb->base;
638 static const struct drm_mode_config_funcs radeon_mode_funcs = {
639 .fb_create = radeon_user_framebuffer_create,
640 .fb_changed = radeonfb_probe,
644 int radeon_modeset_init(struct drm_device *dev)
646 drm_radeon_private_t *dev_priv = dev->dev_private;
647 static struct card_info card;
652 drm_mode_config_init(dev);
654 dev->mode_config.funcs = (void *)&radeon_mode_funcs;
656 if (radeon_is_avivo(dev_priv)) {
657 dev->mode_config.max_width = 8192;
658 dev->mode_config.max_height = 8192;
660 dev->mode_config.max_width = 4096;
661 dev->mode_config.max_height = 4096;
664 dev->mode_config.fb_base = dev_priv->fb_aper_offset;
666 /* allocate crtcs - TODO single crtc */
667 for (i = 0; i < num_crtc; i++) {
668 radeon_crtc_init(dev, i);
671 /* okay we should have all the bios connectors */
673 ret = radeon_setup_enc_conn(dev);
678 drm_helper_initial_config(dev, false);
684 int radeon_load_modeset_init(struct drm_device *dev)
687 ret = radeon_modeset_init(dev);
692 void radeon_modeset_cleanup(struct drm_device *dev)
694 drm_mode_config_cleanup(dev);