Subversion Repositories Kolibri OS

Rev

Rev 3192 | Rev 3746 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3192 Rev 3480
Line 502... Line 502...
502
	return drm_gtf_mode_complex(dev, hdisplay, vdisplay, vrefresh, lace,
502
	return drm_gtf_mode_complex(dev, hdisplay, vdisplay, vrefresh, lace,
503
				    margins, 600, 40 * 2, 128, 20 * 2);
503
				    margins, 600, 40 * 2, 128, 20 * 2);
504
}
504
}
505
EXPORT_SYMBOL(drm_gtf_mode);
505
EXPORT_SYMBOL(drm_gtf_mode);
Line -... Line 506...
-
 
506
 
-
 
507
#if IS_ENABLED(CONFIG_VIDEOMODE)
-
 
508
int drm_display_mode_from_videomode(const struct videomode *vm,
-
 
509
				    struct drm_display_mode *dmode)
-
 
510
{
-
 
511
	dmode->hdisplay = vm->hactive;
-
 
512
	dmode->hsync_start = dmode->hdisplay + vm->hfront_porch;
-
 
513
	dmode->hsync_end = dmode->hsync_start + vm->hsync_len;
-
 
514
	dmode->htotal = dmode->hsync_end + vm->hback_porch;
-
 
515
 
-
 
516
	dmode->vdisplay = vm->vactive;
-
 
517
	dmode->vsync_start = dmode->vdisplay + vm->vfront_porch;
-
 
518
	dmode->vsync_end = dmode->vsync_start + vm->vsync_len;
-
 
519
	dmode->vtotal = dmode->vsync_end + vm->vback_porch;
-
 
520
 
-
 
521
	dmode->clock = vm->pixelclock / 1000;
-
 
522
 
-
 
523
	dmode->flags = 0;
-
 
524
	if (vm->dmt_flags & VESA_DMT_HSYNC_HIGH)
-
 
525
		dmode->flags |= DRM_MODE_FLAG_PHSYNC;
-
 
526
	else if (vm->dmt_flags & VESA_DMT_HSYNC_LOW)
-
 
527
		dmode->flags |= DRM_MODE_FLAG_NHSYNC;
-
 
528
	if (vm->dmt_flags & VESA_DMT_VSYNC_HIGH)
-
 
529
		dmode->flags |= DRM_MODE_FLAG_PVSYNC;
-
 
530
	else if (vm->dmt_flags & VESA_DMT_VSYNC_LOW)
-
 
531
		dmode->flags |= DRM_MODE_FLAG_NVSYNC;
-
 
532
	if (vm->data_flags & DISPLAY_FLAGS_INTERLACED)
-
 
533
		dmode->flags |= DRM_MODE_FLAG_INTERLACE;
-
 
534
	if (vm->data_flags & DISPLAY_FLAGS_DOUBLESCAN)
-
 
535
		dmode->flags |= DRM_MODE_FLAG_DBLSCAN;
-
 
536
	drm_mode_set_name(dmode);
-
 
537
 
-
 
538
	return 0;
-
 
539
}
-
 
540
EXPORT_SYMBOL_GPL(drm_display_mode_from_videomode);
-
 
541
#endif
-
 
542
 
-
 
543
#if IS_ENABLED(CONFIG_OF_VIDEOMODE)
-
 
544
/**
-
 
545
 * of_get_drm_display_mode - get a drm_display_mode from devicetree
-
 
546
 * @np: device_node with the timing specification
-
 
547
 * @dmode: will be set to the return value
-
 
548
 * @index: index into the list of display timings in devicetree
-
 
549
 *
-
 
550
 * This function is expensive and should only be used, if only one mode is to be
-
 
551
 * read from DT. To get multiple modes start with of_get_display_timings and
-
 
552
 * work with that instead.
-
 
553
 */
-
 
554
int of_get_drm_display_mode(struct device_node *np,
-
 
555
			    struct drm_display_mode *dmode, int index)
-
 
556
{
-
 
557
	struct videomode vm;
-
 
558
	int ret;
-
 
559
 
-
 
560
	ret = of_get_videomode(np, &vm, index);
-
 
561
	if (ret)
-
 
562
		return ret;
-
 
563
 
-
 
564
	drm_display_mode_from_videomode(&vm, dmode);
-
 
565
 
-
 
566
	pr_debug("%s: got %dx%d display mode from %s\n",
-
 
567
		of_node_full_name(np), vm.hactive, vm.vactive, np->name);
-
 
568
	drm_mode_debug_printmodeline(dmode);
-
 
569
 
-
 
570
	return 0;
-
 
571
}
-
 
572
EXPORT_SYMBOL_GPL(of_get_drm_display_mode);
-
 
573
#endif
506
 
574
 
507
/**
575
/**
508
 * drm_mode_set_name - set the name on a mode
576
 * drm_mode_set_name - set the name on a mode
509
 * @mode: name will be set in this mode
577
 * @mode: name will be set in this mode
510
 *
578
 *