1 // SPDX-License-Identifier: GPL-2.0+
3 * rcar_du_kms.c -- R-Car Display Unit Mode Setting
5 * Copyright (C) 2013-2015 Renesas Electronics Corporation
10 #include <drm/drm_atomic.h>
11 #include <drm/drm_atomic_helper.h>
12 #include <drm/drm_crtc.h>
13 #include <drm/drm_device.h>
14 #include <drm/drm_fb_cma_helper.h>
15 #include <drm/drm_gem_cma_helper.h>
16 #include <drm/drm_gem_framebuffer_helper.h>
17 #include <drm/drm_managed.h>
18 #include <drm/drm_probe_helper.h>
19 #include <drm/drm_vblank.h>
21 #include <linux/device.h>
22 #include <linux/of_graph.h>
23 #include <linux/of_platform.h>
24 #include <linux/wait.h>
26 #include "rcar_du_crtc.h"
27 #include "rcar_du_drv.h"
28 #include "rcar_du_encoder.h"
29 #include "rcar_du_kms.h"
30 #include "rcar_du_regs.h"
31 #include "rcar_du_vsp.h"
32 #include "rcar_du_writeback.h"
34 /* -----------------------------------------------------------------------------
38 static const struct rcar_du_format_info rcar_du_format_infos[] = {
40 .fourcc = DRM_FORMAT_RGB565,
41 .v4l2 = V4L2_PIX_FMT_RGB565,
45 .pnmr = PnMR_SPIM_TP | PnMR_DDDF_16BPP,
46 .edf = PnDDCR4_EDF_NONE,
48 .fourcc = DRM_FORMAT_ARGB1555,
49 .v4l2 = V4L2_PIX_FMT_ARGB555,
53 .pnmr = PnMR_SPIM_ALP | PnMR_DDDF_ARGB,
54 .edf = PnDDCR4_EDF_NONE,
56 .fourcc = DRM_FORMAT_XRGB1555,
57 .v4l2 = V4L2_PIX_FMT_XRGB555,
60 .pnmr = PnMR_SPIM_ALP | PnMR_DDDF_ARGB,
61 .edf = PnDDCR4_EDF_NONE,
63 .fourcc = DRM_FORMAT_XRGB8888,
64 .v4l2 = V4L2_PIX_FMT_XBGR32,
68 .pnmr = PnMR_SPIM_TP | PnMR_DDDF_16BPP,
69 .edf = PnDDCR4_EDF_RGB888,
71 .fourcc = DRM_FORMAT_ARGB8888,
72 .v4l2 = V4L2_PIX_FMT_ABGR32,
76 .pnmr = PnMR_SPIM_ALP | PnMR_DDDF_16BPP,
77 .edf = PnDDCR4_EDF_ARGB8888,
79 .fourcc = DRM_FORMAT_UYVY,
80 .v4l2 = V4L2_PIX_FMT_UYVY,
84 .pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC,
85 .edf = PnDDCR4_EDF_NONE,
87 .fourcc = DRM_FORMAT_YUYV,
88 .v4l2 = V4L2_PIX_FMT_YUYV,
92 .pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC,
93 .edf = PnDDCR4_EDF_NONE,
95 .fourcc = DRM_FORMAT_NV12,
96 .v4l2 = V4L2_PIX_FMT_NV12M,
100 .pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC,
101 .edf = PnDDCR4_EDF_NONE,
103 .fourcc = DRM_FORMAT_NV21,
104 .v4l2 = V4L2_PIX_FMT_NV21M,
108 .pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC,
109 .edf = PnDDCR4_EDF_NONE,
111 .fourcc = DRM_FORMAT_NV16,
112 .v4l2 = V4L2_PIX_FMT_NV16M,
116 .pnmr = PnMR_SPIM_TP_OFF | PnMR_DDDF_YC,
117 .edf = PnDDCR4_EDF_NONE,
120 * The following formats are not supported on Gen2 and thus have no
121 * associated .pnmr or .edf settings.
124 .fourcc = DRM_FORMAT_RGB332,
125 .v4l2 = V4L2_PIX_FMT_RGB332,
130 .fourcc = DRM_FORMAT_ARGB4444,
131 .v4l2 = V4L2_PIX_FMT_ARGB444,
136 .fourcc = DRM_FORMAT_XRGB4444,
137 .v4l2 = V4L2_PIX_FMT_XRGB444,
142 .fourcc = DRM_FORMAT_RGBA4444,
143 .v4l2 = V4L2_PIX_FMT_RGBA444,
148 .fourcc = DRM_FORMAT_RGBX4444,
149 .v4l2 = V4L2_PIX_FMT_RGBX444,
154 .fourcc = DRM_FORMAT_ABGR4444,
155 .v4l2 = V4L2_PIX_FMT_ABGR444,
160 .fourcc = DRM_FORMAT_XBGR4444,
161 .v4l2 = V4L2_PIX_FMT_XBGR444,
166 .fourcc = DRM_FORMAT_BGRA4444,
167 .v4l2 = V4L2_PIX_FMT_BGRA444,
172 .fourcc = DRM_FORMAT_BGRX4444,
173 .v4l2 = V4L2_PIX_FMT_BGRX444,
178 .fourcc = DRM_FORMAT_RGBA5551,
179 .v4l2 = V4L2_PIX_FMT_RGBA555,
184 .fourcc = DRM_FORMAT_RGBX5551,
185 .v4l2 = V4L2_PIX_FMT_RGBX555,
190 .fourcc = DRM_FORMAT_ABGR1555,
191 .v4l2 = V4L2_PIX_FMT_ABGR555,
196 .fourcc = DRM_FORMAT_XBGR1555,
197 .v4l2 = V4L2_PIX_FMT_XBGR555,
202 .fourcc = DRM_FORMAT_BGRA5551,
203 .v4l2 = V4L2_PIX_FMT_BGRA555,
208 .fourcc = DRM_FORMAT_BGRX5551,
209 .v4l2 = V4L2_PIX_FMT_BGRX555,
214 .fourcc = DRM_FORMAT_BGR888,
215 .v4l2 = V4L2_PIX_FMT_RGB24,
220 .fourcc = DRM_FORMAT_RGB888,
221 .v4l2 = V4L2_PIX_FMT_BGR24,
226 .fourcc = DRM_FORMAT_RGBA8888,
227 .v4l2 = V4L2_PIX_FMT_BGRA32,
232 .fourcc = DRM_FORMAT_RGBX8888,
233 .v4l2 = V4L2_PIX_FMT_BGRX32,
238 .fourcc = DRM_FORMAT_ABGR8888,
239 .v4l2 = V4L2_PIX_FMT_RGBA32,
244 .fourcc = DRM_FORMAT_XBGR8888,
245 .v4l2 = V4L2_PIX_FMT_RGBX32,
250 .fourcc = DRM_FORMAT_BGRA8888,
251 .v4l2 = V4L2_PIX_FMT_ARGB32,
256 .fourcc = DRM_FORMAT_BGRX8888,
257 .v4l2 = V4L2_PIX_FMT_XRGB32,
262 .fourcc = DRM_FORMAT_YVYU,
263 .v4l2 = V4L2_PIX_FMT_YVYU,
268 .fourcc = DRM_FORMAT_NV61,
269 .v4l2 = V4L2_PIX_FMT_NV61M,
274 .fourcc = DRM_FORMAT_YUV420,
275 .v4l2 = V4L2_PIX_FMT_YUV420M,
280 .fourcc = DRM_FORMAT_YVU420,
281 .v4l2 = V4L2_PIX_FMT_YVU420M,
286 .fourcc = DRM_FORMAT_YUV422,
287 .v4l2 = V4L2_PIX_FMT_YUV422M,
292 .fourcc = DRM_FORMAT_YVU422,
293 .v4l2 = V4L2_PIX_FMT_YVU422M,
298 .fourcc = DRM_FORMAT_YUV444,
299 .v4l2 = V4L2_PIX_FMT_YUV444M,
304 .fourcc = DRM_FORMAT_YVU444,
305 .v4l2 = V4L2_PIX_FMT_YVU444M,
312 const struct rcar_du_format_info *rcar_du_format_info(u32 fourcc)
316 for (i = 0; i < ARRAY_SIZE(rcar_du_format_infos); ++i) {
317 if (rcar_du_format_infos[i].fourcc == fourcc)
318 return &rcar_du_format_infos[i];
324 /* -----------------------------------------------------------------------------
328 int rcar_du_dumb_create(struct drm_file *file, struct drm_device *dev,
329 struct drm_mode_create_dumb *args)
331 struct rcar_du_device *rcdu = to_rcar_du_device(dev);
332 unsigned int min_pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
336 * The R8A7779 DU requires a 16 pixels pitch alignment as documented,
337 * but the R8A7790 DU seems to require a 128 bytes pitch alignment.
339 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B))
342 align = 16 * args->bpp / 8;
344 args->pitch = roundup(min_pitch, align);
346 return drm_gem_cma_dumb_create_internal(file, dev, args);
349 static struct drm_framebuffer *
350 rcar_du_fb_create(struct drm_device *dev, struct drm_file *file_priv,
351 const struct drm_mode_fb_cmd2 *mode_cmd)
353 struct rcar_du_device *rcdu = to_rcar_du_device(dev);
354 const struct rcar_du_format_info *format;
355 unsigned int chroma_pitch;
356 unsigned int max_pitch;
360 format = rcar_du_format_info(mode_cmd->pixel_format);
361 if (format == NULL) {
362 dev_dbg(dev->dev, "unsupported pixel format %08x\n",
363 mode_cmd->pixel_format);
364 return ERR_PTR(-EINVAL);
367 if (rcdu->info->gen < 3) {
369 * On Gen2 the DU limits the pitch to 4095 pixels and requires
370 * buffers to be aligned to a 16 pixels boundary (or 128 bytes
371 * on some platforms).
373 unsigned int bpp = format->planes == 1 ? format->bpp / 8 : 1;
375 max_pitch = 4095 * bpp;
377 if (rcar_du_needs(rcdu, RCAR_DU_QUIRK_ALIGN_128B))
383 * On Gen3 the memory interface is handled by the VSP that
384 * limits the pitch to 65535 bytes and has no alignment
391 if (mode_cmd->pitches[0] & (align - 1) ||
392 mode_cmd->pitches[0] > max_pitch) {
393 dev_dbg(dev->dev, "invalid pitch value %u\n",
394 mode_cmd->pitches[0]);
395 return ERR_PTR(-EINVAL);
399 * Calculate the chroma plane(s) pitch using the horizontal subsampling
400 * factor. For semi-planar formats, the U and V planes are combined, the
401 * pitch must thus be doubled.
403 chroma_pitch = mode_cmd->pitches[0] / format->hsub;
404 if (format->planes == 2)
407 for (i = 1; i < format->planes; ++i) {
408 if (mode_cmd->pitches[i] != chroma_pitch) {
410 "luma and chroma pitches are not compatible\n");
411 return ERR_PTR(-EINVAL);
415 return drm_gem_fb_create(dev, file_priv, mode_cmd);
418 /* -----------------------------------------------------------------------------
419 * Atomic Check and Update
422 static int rcar_du_atomic_check(struct drm_device *dev,
423 struct drm_atomic_state *state)
425 struct rcar_du_device *rcdu = to_rcar_du_device(dev);
428 ret = drm_atomic_helper_check(dev, state);
432 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE))
435 return rcar_du_atomic_check_planes(dev, state);
438 static void rcar_du_atomic_commit_tail(struct drm_atomic_state *old_state)
440 struct drm_device *dev = old_state->dev;
441 struct rcar_du_device *rcdu = to_rcar_du_device(dev);
442 struct drm_crtc_state *crtc_state;
443 struct drm_crtc *crtc;
447 * Store RGB routing to DPAD0 and DPAD1, the hardware will be configured
448 * when starting the CRTCs.
450 rcdu->dpad1_source = -1;
452 for_each_new_crtc_in_state(old_state, crtc, crtc_state, i) {
453 struct rcar_du_crtc_state *rcrtc_state =
454 to_rcar_crtc_state(crtc_state);
455 struct rcar_du_crtc *rcrtc = to_rcar_crtc(crtc);
457 if (rcrtc_state->outputs & BIT(RCAR_DU_OUTPUT_DPAD0))
458 rcdu->dpad0_source = rcrtc->index;
460 if (rcrtc_state->outputs & BIT(RCAR_DU_OUTPUT_DPAD1))
461 rcdu->dpad1_source = rcrtc->index;
464 /* Apply the atomic update. */
465 drm_atomic_helper_commit_modeset_disables(dev, old_state);
466 drm_atomic_helper_commit_planes(dev, old_state,
467 DRM_PLANE_COMMIT_ACTIVE_ONLY);
468 drm_atomic_helper_commit_modeset_enables(dev, old_state);
470 drm_atomic_helper_commit_hw_done(old_state);
471 drm_atomic_helper_wait_for_flip_done(dev, old_state);
473 drm_atomic_helper_cleanup_planes(dev, old_state);
476 /* -----------------------------------------------------------------------------
480 static const struct drm_mode_config_helper_funcs rcar_du_mode_config_helper = {
481 .atomic_commit_tail = rcar_du_atomic_commit_tail,
484 static const struct drm_mode_config_funcs rcar_du_mode_config_funcs = {
485 .fb_create = rcar_du_fb_create,
486 .atomic_check = rcar_du_atomic_check,
487 .atomic_commit = drm_atomic_helper_commit,
490 static int rcar_du_encoders_init_one(struct rcar_du_device *rcdu,
491 enum rcar_du_output output,
492 struct of_endpoint *ep)
494 struct device_node *entity;
497 /* Locate the connected entity and initialize the encoder. */
498 entity = of_graph_get_remote_port_parent(ep->local_node);
500 dev_dbg(rcdu->dev, "unconnected endpoint %pOF, skipping\n",
505 if (!of_device_is_available(entity)) {
507 "connected entity %pOF is disabled, skipping\n",
513 ret = rcar_du_encoder_init(rcdu, output, entity);
514 if (ret && ret != -EPROBE_DEFER && ret != -ENOLINK)
516 "failed to initialize encoder %pOF on output %u (%d), skipping\n",
517 entity, output, ret);
524 static int rcar_du_encoders_init(struct rcar_du_device *rcdu)
526 struct device_node *np = rcdu->dev->of_node;
527 struct device_node *ep_node;
528 unsigned int num_encoders = 0;
531 * Iterate over the endpoints and create one encoder for each output
534 for_each_endpoint_of_node(np, ep_node) {
535 enum rcar_du_output output;
536 struct of_endpoint ep;
540 ret = of_graph_parse_endpoint(ep_node, &ep);
542 of_node_put(ep_node);
546 /* Find the output route corresponding to the port number. */
547 for (i = 0; i < RCAR_DU_OUTPUT_MAX; ++i) {
548 if (rcdu->info->routes[i].possible_crtcs &&
549 rcdu->info->routes[i].port == ep.port) {
555 if (i == RCAR_DU_OUTPUT_MAX) {
557 "port %u references unexisting output, skipping\n",
562 /* Process the output pipeline. */
563 ret = rcar_du_encoders_init_one(rcdu, output, &ep);
565 if (ret == -EPROBE_DEFER) {
566 of_node_put(ep_node);
579 static int rcar_du_properties_init(struct rcar_du_device *rcdu)
582 * The color key is expressed as an RGB888 triplet stored in a 32-bit
583 * integer in XRGB8888 format. Bit 24 is used as a flag to disable (0)
584 * or enable source color keying (1).
586 rcdu->props.colorkey =
587 drm_property_create_range(&rcdu->ddev, 0, "colorkey",
589 if (rcdu->props.colorkey == NULL)
595 static int rcar_du_vsps_init(struct rcar_du_device *rcdu)
597 const struct device_node *np = rcdu->dev->of_node;
598 const char *vsps_prop_name = "renesas,vsps";
599 struct of_phandle_args args;
601 struct device_node *np;
602 unsigned int crtcs_mask;
603 } vsps[RCAR_DU_MAX_VSPS] = { { NULL, }, };
604 unsigned int vsps_count = 0;
610 * First parse the DT vsps property to populate the list of VSPs. Each
611 * entry contains a pointer to the VSP DT node and a bitmask of the
612 * connected DU CRTCs.
614 ret = of_property_count_u32_elems(np, vsps_prop_name);
616 /* Backward compatibility with old DTBs. */
617 vsps_prop_name = "vsps";
618 ret = of_property_count_u32_elems(np, vsps_prop_name);
620 cells = ret / rcdu->num_crtcs - 1;
624 for (i = 0; i < rcdu->num_crtcs; ++i) {
627 ret = of_parse_phandle_with_fixed_args(np, vsps_prop_name,
633 * Add the VSP to the list or update the corresponding existing
634 * entry if the VSP has already been added.
636 for (j = 0; j < vsps_count; ++j) {
637 if (vsps[j].np == args.np)
642 of_node_put(args.np);
644 vsps[vsps_count++].np = args.np;
646 vsps[j].crtcs_mask |= BIT(i);
649 * Store the VSP pointer and pipe index in the CRTC. If the
650 * second cell of the 'renesas,vsps' specifier isn't present,
651 * default to 0 to remain compatible with older DT bindings.
653 rcdu->crtcs[i].vsp = &rcdu->vsps[j];
654 rcdu->crtcs[i].vsp_pipe = cells >= 1 ? args.args[0] : 0;
658 * Then initialize all the VSPs from the node pointers and CRTCs bitmask
659 * computed previously.
661 for (i = 0; i < vsps_count; ++i) {
662 struct rcar_du_vsp *vsp = &rcdu->vsps[i];
667 ret = rcar_du_vsp_init(vsp, vsps[i].np, vsps[i].crtcs_mask);
675 for (i = 0; i < ARRAY_SIZE(vsps); ++i)
676 of_node_put(vsps[i].np);
681 static int rcar_du_cmm_init(struct rcar_du_device *rcdu)
683 const struct device_node *np = rcdu->dev->of_node;
687 cells = of_property_count_u32_elems(np, "renesas,cmms");
688 if (cells == -EINVAL)
691 if (cells > rcdu->num_crtcs) {
693 "Invalid number of entries in 'renesas,cmms'\n");
697 for (i = 0; i < cells; ++i) {
698 struct platform_device *pdev;
699 struct device_link *link;
700 struct device_node *cmm;
703 cmm = of_parse_phandle(np, "renesas,cmms", i);
706 "Failed to parse 'renesas,cmms' property\n");
710 if (!of_device_is_available(cmm)) {
711 /* It's fine to have a phandle to a non-enabled CMM. */
716 pdev = of_find_device_by_node(cmm);
718 dev_err(rcdu->dev, "No device found for CMM%u\n", i);
726 * -ENODEV is used to report that the CMM config option is
727 * disabled: return 0 and let the DU continue probing.
729 ret = rcar_cmm_init(pdev);
731 platform_device_put(pdev);
732 return ret == -ENODEV ? 0 : ret;
735 rcdu->cmms[i] = pdev;
738 * Enforce suspend/resume ordering by making the CMM a provider
739 * of the DU: CMM is suspended after and resumed before the DU.
741 link = device_link_add(rcdu->dev, &pdev->dev, DL_FLAG_STATELESS);
744 "Failed to create device link to CMM%u\n", i);
752 static void rcar_du_modeset_cleanup(struct drm_device *dev, void *res)
754 struct rcar_du_device *rcdu = to_rcar_du_device(dev);
757 for (i = 0; i < ARRAY_SIZE(rcdu->cmms); ++i)
758 platform_device_put(rcdu->cmms[i]);
761 int rcar_du_modeset_init(struct rcar_du_device *rcdu)
763 static const unsigned int mmio_offsets[] = {
764 DU0_REG_OFFSET, DU2_REG_OFFSET
767 struct drm_device *dev = &rcdu->ddev;
768 struct drm_encoder *encoder;
769 unsigned int dpad0_sources;
770 unsigned int num_encoders;
771 unsigned int num_groups;
772 unsigned int swindex;
773 unsigned int hwindex;
777 ret = drmm_mode_config_init(dev);
781 ret = drmm_add_action(&rcdu->ddev, rcar_du_modeset_cleanup, NULL);
785 dev->mode_config.min_width = 0;
786 dev->mode_config.min_height = 0;
787 dev->mode_config.normalize_zpos = true;
788 dev->mode_config.funcs = &rcar_du_mode_config_funcs;
789 dev->mode_config.helper_private = &rcar_du_mode_config_helper;
791 if (rcdu->info->gen < 3) {
792 dev->mode_config.max_width = 4095;
793 dev->mode_config.max_height = 2047;
796 * The Gen3 DU uses the VSP1 for memory access, and is limited
797 * to frame sizes of 8190x8190.
799 dev->mode_config.max_width = 8190;
800 dev->mode_config.max_height = 8190;
803 rcdu->num_crtcs = hweight8(rcdu->info->channels_mask);
805 ret = rcar_du_properties_init(rcdu);
810 * Initialize vertical blanking interrupts handling. Start with vblank
811 * disabled for all CRTCs.
813 ret = drm_vblank_init(dev, rcdu->num_crtcs);
817 /* Initialize the groups. */
818 num_groups = DIV_ROUND_UP(rcdu->num_crtcs, 2);
820 for (i = 0; i < num_groups; ++i) {
821 struct rcar_du_group *rgrp = &rcdu->groups[i];
823 mutex_init(&rgrp->lock);
826 rgrp->mmio_offset = mmio_offsets[i];
828 /* Extract the channel mask for this group only. */
829 rgrp->channels_mask = (rcdu->info->channels_mask >> (2 * i))
831 rgrp->num_crtcs = hweight8(rgrp->channels_mask);
834 * If we have more than one CRTCs in this group pre-associate
835 * the low-order planes with CRTC 0 and the high-order planes
836 * with CRTC 1 to minimize flicker occurring when the
837 * association is changed.
839 rgrp->dptsr_planes = rgrp->num_crtcs > 1
840 ? (rcdu->info->gen >= 3 ? 0x04 : 0xf0)
843 if (!rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) {
844 ret = rcar_du_planes_init(rgrp);
850 /* Initialize the compositors. */
851 if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSP1_SOURCE)) {
852 ret = rcar_du_vsps_init(rcdu);
857 /* Initialize the Color Management Modules. */
858 ret = rcar_du_cmm_init(rcdu);
862 /* Create the CRTCs. */
863 for (swindex = 0, hwindex = 0; swindex < rcdu->num_crtcs; ++hwindex) {
864 struct rcar_du_group *rgrp;
866 /* Skip unpopulated DU channels. */
867 if (!(rcdu->info->channels_mask & BIT(hwindex)))
870 rgrp = &rcdu->groups[hwindex / 2];
872 ret = rcar_du_crtc_create(rgrp, swindex++, hwindex);
877 /* Initialize the encoders. */
878 ret = rcar_du_encoders_init(rcdu);
883 dev_err(rcdu->dev, "error: no encoder could be initialized\n");
890 * Set the possible CRTCs and possible clones. There's always at least
891 * one way for all encoders to clone each other, set all bits in the
892 * possible clones field.
894 list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
895 struct rcar_du_encoder *renc = to_rcar_encoder(encoder);
896 const struct rcar_du_output_routing *route =
897 &rcdu->info->routes[renc->output];
899 encoder->possible_crtcs = route->possible_crtcs;
900 encoder->possible_clones = (1 << num_encoders) - 1;
903 /* Create the writeback connectors. */
904 if (rcdu->info->gen >= 3) {
905 for (i = 0; i < rcdu->num_crtcs; ++i) {
906 struct rcar_du_crtc *rcrtc = &rcdu->crtcs[i];
908 ret = rcar_du_writeback_init(rcdu, rcrtc);
915 * Initialize the default DPAD0 source to the index of the first DU
916 * channel that can be connected to DPAD0. The exact value doesn't
917 * matter as it should be overwritten by mode setting for the RGB
918 * output, but it is nonetheless required to ensure a valid initial
919 * hardware configuration on Gen3 where DU0 can't always be connected to
922 dpad0_sources = rcdu->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs;
923 rcdu->dpad0_source = ffs(dpad0_sources) - 1;
925 drm_mode_config_reset(dev);
927 drm_kms_helper_poll_init(dev);