Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR for vgpu-dev #10

Merged
merged 11 commits into from
May 29, 2017
1,060 changes: 0 additions & 1,060 deletions arch/arm64/boot/dts/renesas/r8a7795-salvator-x-dom0.dts

This file was deleted.

522 changes: 0 additions & 522 deletions arch/arm64/boot/dts/renesas/r8a7796-m3ulcb-dom0.dts

This file was deleted.

2 changes: 2 additions & 0 deletions drivers/gpu/drm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,8 @@ source "drivers/gpu/drm/hisilicon/Kconfig"

source "drivers/gpu/drm/mediatek/Kconfig"

source "drivers/gpu/drm/xen/Kconfig"

# Keep legacy drivers last

menuconfig DRM_LEGACY
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -86,3 +86,4 @@ obj-$(CONFIG_DRM_FSL_DCU) += fsl-dcu/
obj-$(CONFIG_DRM_ETNAVIV) += etnaviv/
obj-$(CONFIG_DRM_ARCPGU)+= arc/
obj-y += hisilicon/
obj-$(CONFIG_DRM_XEN) += xen/
40 changes: 40 additions & 0 deletions drivers/gpu/drm/rcar-du/rcar_du_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -702,6 +702,7 @@ static irqreturn_t rcar_du_crtc_irq(int irq, void *arg)
/* -----------------------------------------------------------------------------
* Initialization
*/
#define RGX_3DGE_CORE_CLOCK_SPEED 600000000

int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
{
Expand All @@ -720,6 +721,7 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
char *name;
int irq;
int ret;
static int setup_gfx_clk = false;

if (rcar_du_has(rcdu, RCAR_DU_FEATURE_VSPDL_SOURCE)) {
if (index == rcdu->info->vspdl_pair_ch)
Expand Down Expand Up @@ -756,6 +758,44 @@ int rcar_du_crtc_create(struct rcar_du_group *rgrp, unsigned int index)
return -EPROBE_DEFER;
}

if (!setup_gfx_clk) {
unsigned long new_rate, cur_rate;

strcpy(clk_name, "3dge");
clk = devm_clk_get(rcdu->dev, clk_name);
if (IS_ERR(clk)) {
dev_err(rcdu->dev, "no clk for GFX\n");
setup_gfx_clk = true;
goto gfx_skip;
}

new_rate = clk_round_rate(clk, RGX_3DGE_CORE_CLOCK_SPEED + 1000000);
if (new_rate <= 0) {
dev_err(rcdu->dev, "clk_round_rate for GFX clk failed. res = %ld\n", new_rate);
return -1;
}

cur_rate = clk_get_rate(clk);
if (cur_rate != new_rate) {
ret = clk_set_rate(clk, new_rate);
if (ret < 0) {
dev_err(rcdu->dev, "clk_set_rate for GFX clk failed. res = %d\n", ret);
return ret;
}
}

ret = clk_prepare_enable(clk);
if (ret < 0) {
dev_err(rcdu->dev, "clk_prepare_enable for GFX clk failed. res = %d\n", ret);
return ret;
}

dev_err(rcdu->dev, "GFX clk enabled\n");

setup_gfx_clk = true;
}

gfx_skip:
init_waitqueue_head(&rcrtc->flip_wait);

rcrtc->group = rgrp;
Expand Down
62 changes: 62 additions & 0 deletions drivers/gpu/drm/xen/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
config DRM_XEN
bool "DRM Support for Xen guest OS (EXPERIMENTAL)"
depends on XEN
help
Choose this option if you want to enable DRM support
for Xen.

config DRM_XEN_FRONTEND
tristate "Front-end paravirtualized driver for Xen guest OS"
depends on DRM_XEN
depends on DRM
select DRM_KMS_HELPER
select VIDEOMODE_HELPERS
select XEN_XENBUS_FRONTEND
help
Choose this option if you want to enable a paravirtualized
front-end DRM driver for Xen guest OSes.

config DRM_XEN_FRONTEND_CMA
bool "Use DRM CMA to allocate dumb buffers"
depends on DRM_XEN_FRONTEND=y
select DRM_KMS_CMA_HELPER
select DRM_GEM_CMA_HELPER
help
Use DRM CMA to allocate dumb buffers.
This is only available for built-in driver, because
there is a dependency on DMA ops which are only available
for built-in code.
Note: in this mode driver cannot use buffers allocated
by backend.

config DRM_XEN_ZCOPY
tristate "Zero copy driver for Xen"
depends on DRM_XEN
depends on DRM
select DRM_KMS_HELPER
help
Choose this option if you want to enable a zero copy
DRM driver for Xen. This is implemented via mapping
of foreign dumb buffer pages into current domain and
exporting new dumb via PRIME interface. This allows
domains to use buffers of unpriveledged ones without
additional memory copying.

config DRM_XEN_ZCOPY_WA_SWIOTLB
bool "Workaround SWIOTLB"
depends on DRM_XEN_ZCOPY
depends on SWIOTLB
help
While exporting scatter-gather table use individual
pages rather combining contiguous chunks. This may
help systems which suffer from SWIOTLB buffer
overflows.

config DRM_XEN_ZCOPY_CMA
bool "Use CMA to allocate buffers"
depends on DRM_XEN_ZCOPY=y
help
Use CMA to allocate buffers.
This is only available for built-in driver, because
there is a dependency on DMA ops which are only available
for built-in code.
16 changes: 16 additions & 0 deletions drivers/gpu/drm/xen/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#
# Makefile for the drm device driver. This driver provides support for the
# Direct Rendering Infrastructure (DRI) in XFree86 4.1.0 and higher.

drm_xen_front-objs := xen_drm_front.o xen_drm_drv.o xen_drm_kms.o xen_drm_crtc.o \
xen_drm_timer.o xen_drm_shbuf.o

ifneq ($(CONFIG_DRM_XEN_FRONTEND_CMA),y)
drm_xen_front-objs += xen_drm_gem.o
endif

obj-$(CONFIG_DRM_XEN_FRONTEND) += drm_xen_front.o

drm_xen_zcopy-objs := xen_drm_zcopy_drv.o

obj-$(CONFIG_DRM_XEN_ZCOPY) += drm_xen_zcopy.o
Loading