[Openchrome-devel] drm-openchrome: 2 commits - drivers/gpu/drm
James Simmons
jsimmons at kemper.freedesktop.org
Sat Dec 14 12:25:54 PST 2013
drivers/gpu/drm/via/init_ttm.c | 11 +++++------
drivers/gpu/drm/via/ttm_gem.c | 3 ++-
drivers/gpu/drm/via/via_crtc.c | 2 +-
drivers/gpu/drm/via/via_display.c | 4 ++--
drivers/gpu/drm/via/via_drv.c | 5 ++---
drivers/gpu/drm/via/via_drv.h | 1 -
drivers/gpu/drm/via/via_fb.c | 7 ++++---
drivers/gpu/drm/via/via_h1_cmdbuf.c | 2 +-
drivers/gpu/drm/via/via_hdmi.c | 2 +-
drivers/gpu/drm/via/via_ioc32.c | 2 +-
drivers/gpu/drm/via/via_irq.c | 8 ++++----
drivers/gpu/drm/via/via_lvds.c | 32 ++++++++++++++++----------------
drivers/gpu/drm/via/via_pm.c | 2 +-
drivers/gpu/drm/via/via_tmds.c | 2 +-
drivers/gpu/drm/via/via_ttm.c | 2 +-
15 files changed, 42 insertions(+), 43 deletions(-)
New commits:
commit f3ab97ba782d7a5b245c5be8a8226c22700983a8
Author: James Simmons <jsimmons at infradead.org>
Date: Sat Dec 14 13:05:50 2013 -0500
Move the handling of the shmem backend setting from ttm_bo_allocate to the gem functions instead.
diff --git a/drivers/gpu/drm/via/init_ttm.c b/drivers/gpu/drm/via/init_ttm.c
index aab0221..1688d4f 100644
--- a/drivers/gpu/drm/via/init_ttm.c
+++ b/drivers/gpu/drm/via/init_ttm.c
@@ -153,7 +153,6 @@ ttm_bo_allocate(struct ttm_bo_device *bdev,
uint32_t page_align,
bool interruptible,
struct sg_table *sg,
- struct file *persistant_swap_storage,
struct ttm_buffer_object **p_bo)
{
unsigned long acc_size = sizeof(struct ttm_heap);
@@ -174,10 +173,10 @@ ttm_bo_allocate(struct ttm_bo_device *bdev,
ttm_placement_from_domain(bo, &placement, domains, bdev);
ret = ttm_bo_init(bdev, bo, size, origin, &placement,
- page_align >> PAGE_SHIFT,
- interruptible, persistant_swap_storage,
- ttm_bo_dma_acc_size(bdev, size, acc_size),
- sg, ttm_buffer_object_destroy);
+ page_align >> PAGE_SHIFT,
+ interruptible, NULL,
+ ttm_bo_dma_acc_size(bdev, size, acc_size),
+ sg, ttm_buffer_object_destroy);
if (unlikely(ret))
kfree(heap);
else
@@ -237,7 +236,7 @@ ttm_allocate_kernel_buffer(struct ttm_bo_device *bdev, unsigned long size,
{
int ret = ttm_bo_allocate(bdev, size, ttm_bo_type_kernel, domain,
alignment, PAGE_SIZE, false, NULL,
- NULL, &kmap->bo);
+ &kmap->bo);
if (likely(!ret)) {
ret = ttm_bo_pin(kmap->bo, kmap);
if (unlikely(ret)) {
diff --git a/drivers/gpu/drm/via/ttm_gem.c b/drivers/gpu/drm/via/ttm_gem.c
index 4c30b8b..a78c2a01 100644
--- a/drivers/gpu/drm/via/ttm_gem.c
+++ b/drivers/gpu/drm/via/ttm_gem.c
@@ -83,12 +83,13 @@ ttm_gem_create(struct drm_device *dev, struct ttm_bo_device *bdev, int types,
ret = ttm_bo_allocate(bdev, size, ttm_bo_type_device, types,
byte_align, page_align, interruptible,
- NULL, obj->filp, &bo);
+ NULL, &bo);
if (ret) {
DRM_ERROR("Failed to create buffer object\n");
drm_gem_object_unreference_unlocked(obj);
return ERR_PTR(ret);
}
+ bo->persistent_swap_storage = obj->filp;
obj->driver_private = bo;
return obj;
}
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index ac17d3d..d425db0 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -152,8 +152,7 @@ via_mmio_setup(struct drm_device *dev)
return ret;
ret = ttm_bo_allocate(&dev_priv->bdev, VIA_MMIO_REGSIZE, ttm_bo_type_kernel,
- TTM_PL_FLAG_PRIV0, 1, PAGE_SIZE, false, NULL,
- NULL, &bo);
+ TTM_PL_FLAG_PRIV0, 1, PAGE_SIZE, false, NULL, &bo);
if (ret)
goto err;
diff --git a/drivers/gpu/drm/via/via_drv.h b/drivers/gpu/drm/via/via_drv.h
index 5198a43..9e6bc02 100644
--- a/drivers/gpu/drm/via/via_drv.h
+++ b/drivers/gpu/drm/via/via_drv.h
@@ -226,7 +226,6 @@ extern int ttm_bo_allocate(struct ttm_bo_device *bdev, unsigned long size,
enum ttm_bo_type origin, int types,
uint32_t byte_align, uint32_t page_align,
bool interruptible, struct sg_table *sg,
- struct file *persistant_swap_storage,
struct ttm_buffer_object **p_bo);
extern void ttm_placement_from_domain(struct ttm_buffer_object *bo,
struct ttm_placement *placement, u32 domains,
diff --git a/drivers/gpu/drm/via/via_fb.c b/drivers/gpu/drm/via/via_fb.c
index 06ac2df..b42e251 100644
--- a/drivers/gpu/drm/via/via_fb.c
+++ b/drivers/gpu/drm/via/via_fb.c
@@ -1027,9 +1027,10 @@ via_fb_probe(struct drm_fb_helper *helper,
}
ret = ttm_bo_allocate(&dev_priv->bdev, size, ttm_bo_type_kernel,
TTM_PL_FLAG_VRAM, 1, PAGE_SIZE, false,
- NULL, obj->filp, &kmap->bo);
+ NULL, &kmap->bo);
if (unlikely(ret))
goto out_err;
+ kmap->bo->persistent_swap_storage = obj->filp;
ret = ttm_bo_pin(kmap->bo, kmap);
if (unlikely(ret))
diff --git a/drivers/gpu/drm/via/via_h1_cmdbuf.c b/drivers/gpu/drm/via/via_h1_cmdbuf.c
index e5087f9..e4e0698 100644
--- a/drivers/gpu/drm/via/via_h1_cmdbuf.c
+++ b/drivers/gpu/drm/via/via_h1_cmdbuf.c
@@ -161,7 +161,7 @@ static int via_initialize(struct drm_device *dev,
ret = ttm_bo_allocate(&dev_priv->bdev, init->size, ttm_bo_type_kernel,
TTM_PL_FLAG_TT, VIA_MM_ALIGN_SIZE, PAGE_SIZE,
- false, NULL, NULL, &bo);
+ false, NULL, &bo);
if (!ret) {
ret = ttm_bo_pin(bo, &dev_priv->dmabuf);
if (ret)
commit 558a29fcc23c35eada8d71b94bdb9a4874cd7b7c
Author: James Simmons <jsimmons at infradead.org>
Date: Sat Dec 14 12:10:43 2013 -0500
drm/via: used device field of struct pci_device
Detect which pci device the graphic hardware is using
the struct pci_device since pci_device in struct drm_device
will go away in the future.
Signed-off-by: James Simmons <jsimmons at infradead.org>
diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index f7c8a7e..546066e 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -582,7 +582,7 @@ void via_set_scale_path(struct drm_crtc *crtc, u32 scale_type)
reg_cr_fd &= ~BIT(7);
/* only IGA1 up scaling need to clear this bit CRFD.5. */
- if (dev->pci_device == PCI_DEVICE_ID_VIA_VX900_VGA) {
+ if (dev->pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA) {
if (!iga->index && ((VIA_HOR_EXPAND & scale_type) ||
(VIA_VER_EXPAND & scale_type)))
reg_cr_fd &= ~BIT(5);
diff --git a/drivers/gpu/drm/via/via_display.c b/drivers/gpu/drm/via/via_display.c
index bdc2401..706e59d 100644
--- a/drivers/gpu/drm/via/via_display.c
+++ b/drivers/gpu/drm/via/via_display.c
@@ -387,7 +387,7 @@ via_init_td_timing_regs(struct drm_device *dev)
/* Note: VT3353 have two hardware power sequences
* other chips only have one hardware power sequence */
- if (dev->pci_device == PCI_DEVICE_ID_VIA_VT1122) {
+ if (dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) {
/* set CRD4[0] to "1" to select 2nd LCD power sequence. */
svga_wcrt_mask(VGABASE, 0xD4, BIT(0), BIT(0));
/* Fill secondary power sequence */
@@ -480,7 +480,7 @@ via_display_init(struct drm_device *dev)
u8 index = 0x3D, value;
/* Check if spread spectrum is enabled */
- if (dev->pci_device == PCI_DEVICE_ID_VIA_VX900_VGA)
+ if (dev->pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA)
index = 0x2C;
value = vga_rseq(VGABASE, 0x1E);
diff --git a/drivers/gpu/drm/via/via_drv.c b/drivers/gpu/drm/via/via_drv.c
index 209f8da..ac17d3d 100644
--- a/drivers/gpu/drm/via/via_drv.c
+++ b/drivers/gpu/drm/via/via_drv.c
@@ -173,7 +173,7 @@ chip_revision_info(struct drm_device *dev)
struct drm_via_private *dev_priv = dev->dev_private;
u8 tmp;
- switch (dev->pci_device) {
+ switch (dev->pdev->device) {
/* Check revision of CLE266 Chip */
case PCI_DEVICE_ID_VIA_CLE266:
/* CR4F only define in CLE266.CX chip */
diff --git a/drivers/gpu/drm/via/via_fb.c b/drivers/gpu/drm/via/via_fb.c
index 49f0a22..06ac2df 100644
--- a/drivers/gpu/drm/via/via_fb.c
+++ b/drivers/gpu/drm/via/via_fb.c
@@ -717,8 +717,8 @@ int via_detect_vram(struct drm_device *dev)
goto out_err;
}
- if (!fn3 && dev->pci_device != PCI_DEVICE_ID_VIA_CLE266
- && dev->pci_device != PCI_DEVICE_ID_VIA_KM400) {
+ if (!fn3 && dev->pdev->device != PCI_DEVICE_ID_VIA_CLE266
+ && dev->pdev->device != PCI_DEVICE_ID_VIA_KM400) {
ret = -EINVAL;
DRM_ERROR("No function 3 on host bridge...\n");
goto out_err;
diff --git a/drivers/gpu/drm/via/via_hdmi.c b/drivers/gpu/drm/via/via_hdmi.c
index f7a4dda..821b621 100644
--- a/drivers/gpu/drm/via/via_hdmi.c
+++ b/drivers/gpu/drm/via/via_hdmi.c
@@ -272,7 +272,7 @@ via_hdmi_enc_mode_set(struct drm_encoder *encoder,
/* FIXME VIA where do you get this value from ??? */
u32 v_sync_adjust = 0;
- switch (dev->pci_device) {
+ switch (dev->pdev->device) {
case PCI_DEVICE_ID_VIA_VX875:
svga_wcrt_mask(VGABASE, 0xFB,
v_sync_adjust & 0xFF, 0xFF);
diff --git a/drivers/gpu/drm/via/via_ioc32.c b/drivers/gpu/drm/via/via_ioc32.c
index 596e40c..a0738c1 100644
--- a/drivers/gpu/drm/via/via_ioc32.c
+++ b/drivers/gpu/drm/via/via_ioc32.c
@@ -38,7 +38,7 @@ via_getparam(struct drm_device *dev, void *data,
switch (args->param) {
case VIA_PARAM_CHIPSET_ID:
- args->value = dev->pci_device;
+ args->value = dev->pdev->device;
break;
case VIA_PARAM_REVISION_ID:
args->value = dev_priv->revision;
diff --git a/drivers/gpu/drm/via/via_irq.c b/drivers/gpu/drm/via/via_irq.c
index 5bccc31..fc58ad8 100644
--- a/drivers/gpu/drm/via/via_irq.c
+++ b/drivers/gpu/drm/via/via_irq.c
@@ -204,8 +204,8 @@ via_hpd_irq_process(struct drm_via_private *dev_priv)
}
/* internal TMDS sense */
- if ((dev_priv->dev->pci_device != PCI_DEVICE_ID_VIA_VX875) ||
- (dev_priv->dev->pci_device != PCI_DEVICE_ID_VIA_VX900_VGA)) {
+ if ((dev_priv->dev->pdev->device != PCI_DEVICE_ID_VIA_VX875) ||
+ (dev_priv->dev->pdev->device != PCI_DEVICE_ID_VIA_VX900_VGA)) {
if (VIA_IRQ_IN_TMDS_ENABLE & mm_1280) {
if (VIA_IRQ_IN_TMDS_STATUS & mm_1280) {
ret = IRQ_HANDLED;
@@ -345,8 +345,8 @@ via_hpd_irq_state(struct drm_via_private *dev_priv, bool enable)
*/
mask = VIA_IRQ_CRT_ENABLE | VIA_IRQ_CRT_STATUS;
- if ((dev_priv->dev->pci_device != PCI_DEVICE_ID_VIA_VX875) ||
- (dev_priv->dev->pci_device != PCI_DEVICE_ID_VIA_VX900_VGA)) {
+ if ((dev_priv->dev->pdev->device != PCI_DEVICE_ID_VIA_VX875) ||
+ (dev_priv->dev->pdev->device != PCI_DEVICE_ID_VIA_VX900_VGA)) {
/* Internal DVI - DFPL port */
mask |= VIA_IRQ_IN_TMDS_ENABLE | VIA_IRQ_IN_TMDS_STATUS;
} else {
diff --git a/drivers/gpu/drm/via/via_lvds.c b/drivers/gpu/drm/via/via_lvds.c
index f9a4802..38281a0 100644
--- a/drivers/gpu/drm/via/via_lvds.c
+++ b/drivers/gpu/drm/via/via_lvds.c
@@ -74,8 +74,8 @@ via_enable_internal_lvds(struct drm_encoder *encoder)
/* Turn on LCD panel */
if ((enc->diPort & DISP_DI_DFPL) || (enc->diPort == DISP_DI_DVP1)) {
- if ((dev->pci_device == PCI_DEVICE_ID_VIA_VT1122) ||
- (dev->pci_device == PCI_DEVICE_ID_VIA_CLE266)) {
+ if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
+ (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
/* Software control power sequence ON */
svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(7));
svga_wcrt_mask(VGABASE, 0x91, BIT(0), BIT(0));
@@ -105,8 +105,8 @@ via_enable_internal_lvds(struct drm_encoder *encoder)
}
if (enc->diPort & DISP_DI_DFPH) {
- if ((dev->pci_device == PCI_DEVICE_ID_VIA_VT1122) ||
- (dev->pci_device == PCI_DEVICE_ID_VIA_CLE266)) {
+ if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
+ (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
/* Software control power sequence ON */
svga_wcrt_mask(VGABASE, 0xD4, 0x00, BIT(1));
svga_wcrt_mask(VGABASE, 0xD3, BIT(0), BIT(0));
@@ -157,8 +157,8 @@ via_disable_internal_lvds(struct drm_encoder *encoder)
/* Turn off LCD panel */
if ((enc->diPort & DISP_DI_DFPL) || (enc->diPort == DISP_DI_DVP1)) {
/* Set LCD software power sequence off */
- if ((dev->pci_device == PCI_DEVICE_ID_VIA_VT1122) ||
- (dev->pci_device == PCI_DEVICE_ID_VIA_CLE266)) {
+ if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
+ (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
/* Back-Light OFF */
svga_wcrt_mask(VGABASE, 0x91, 0x00, BIT(1));
/* Delay td3 msec. */
@@ -183,8 +183,8 @@ via_disable_internal_lvds(struct drm_encoder *encoder)
if (enc->diPort & DISP_DI_DFPH) {
/* Set LCD software power sequence off */
- if ((dev->pci_device == PCI_DEVICE_ID_VIA_VT1122) ||
- (dev->pci_device == PCI_DEVICE_ID_VIA_CLE266)) {
+ if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
+ (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)) {
/* Back-Light OFF */
svga_wcrt_mask(VGABASE, 0xD3, 0x00, BIT(1));
/* Delay td3 msec. */
@@ -238,9 +238,9 @@ via_lvds_dpms(struct drm_encoder *encoder, int mode)
svga_wcrt_mask(VGABASE, 0x6A, BIT(3), BIT(3));
if (dev_priv->spread_spectrum) {
- if ((dev->pci_device == PCI_DEVICE_ID_VIA_VT1122) ||
- (dev->pci_device == PCI_DEVICE_ID_VIA_VX875) ||
- (dev->pci_device == PCI_DEVICE_ID_VIA_VX900_VGA)) {
+ if ((dev->pdev->device == PCI_DEVICE_ID_VIA_VT1122) ||
+ (dev->pdev->device == PCI_DEVICE_ID_VIA_VX875) ||
+ (dev->pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA)) {
/* GPIO-4/5 are used for spread spectrum,
* we must clear SR3D[7:6] to disable
* GPIO-4/5 output */
@@ -355,7 +355,7 @@ via_lcd_detect(struct drm_connector *connector, bool force)
struct drm_via_private *dev_priv = connector->dev->dev_private;
u8 mask = BIT(1);
- if (connector->dev->pci_device == PCI_DEVICE_ID_VIA_CLE266)
+ if (connector->dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)
mask = BIT(3);
if (vga_rcrt(VGABASE, 0x3B) & mask)
@@ -595,7 +595,7 @@ via_lcd_mode_valid(struct drm_connector *connector,
return MODE_PANEL;
/* Don't support mode larger than physical size */
- if (dev->pci_device != PCI_DEVICE_ID_VIA_VX900_VGA) {
+ if (dev->pdev->device != PCI_DEVICE_ID_VIA_VX900_VGA) {
if (mode->hdisplay > native_mode->hdisplay)
return MODE_PANEL;
if (mode->vdisplay > native_mode->vdisplay)
@@ -677,7 +677,7 @@ via_lvds_init(struct drm_device *dev)
drm_connector_helper_add(&con->base, &via_lcd_connector_helper_funcs);
drm_sysfs_connector_add(&con->base);
- switch (dev->pci_device) {
+ switch (dev->pdev->device) {
case PCI_DEVICE_ID_VIA_VX875:
case PCI_DEVICE_ID_VIA_VX900_VGA:
con->ddc_bus = via_find_ddc_bus(0x2C);
@@ -692,7 +692,7 @@ via_lvds_init(struct drm_device *dev)
if (!machine_is_olpc()) {
u8 mask = BIT(1);
- if (dev->pci_device == PCI_DEVICE_ID_VIA_CLE266)
+ if (dev->pdev->device == PCI_DEVICE_ID_VIA_CLE266)
mask = BIT(3);
/* First we have to make sure a LVDS is present */
@@ -755,7 +755,7 @@ via_lvds_init(struct drm_device *dev)
enc->base.possible_crtcs = BIT(1) | BIT(0);
- switch (dev->pci_device) {
+ switch (dev->pdev->device) {
case PCI_DEVICE_ID_VIA_CLE266:
enc->diPort = DISP_DI_DVP1;
break;
diff --git a/drivers/gpu/drm/via/via_pm.c b/drivers/gpu/drm/via/via_pm.c
index f2158bf..a0b88ec 100644
--- a/drivers/gpu/drm/via/via_pm.c
+++ b/drivers/gpu/drm/via/via_pm.c
@@ -238,7 +238,7 @@ via_engine_init(struct drm_device *dev)
struct drm_via_private *dev_priv = dev->dev_private;
/* initial engines */
- via_init_2d(dev_priv, dev->pci_device);
+ via_init_2d(dev_priv, dev->pdev->device);
via_init_3d(dev_priv);
via_init_vq(dev_priv);
diff --git a/drivers/gpu/drm/via/via_tmds.c b/drivers/gpu/drm/via/via_tmds.c
index 86f0ef7..8318103 100644
--- a/drivers/gpu/drm/via/via_tmds.c
+++ b/drivers/gpu/drm/via/via_tmds.c
@@ -154,7 +154,7 @@ via_tmds_init(struct drm_device *dev)
drm_connector_helper_add(&con->base, &via_dvi_connector_helper_funcs);
drm_sysfs_connector_add(&con->base);
- switch (dev->pci_device) {
+ switch (dev->pdev->device) {
case PCI_DEVICE_ID_VIA_VT1122:
if (dev_priv->revision < VX800_REVISION_B1)
break;
diff --git a/drivers/gpu/drm/via/via_ttm.c b/drivers/gpu/drm/via/via_ttm.c
index 3e94c16..08e9c1e 100644
--- a/drivers/gpu/drm/via/via_ttm.c
+++ b/drivers/gpu/drm/via/via_ttm.c
@@ -444,7 +444,7 @@ via_ttm_io_mem_reserve(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem)
break;
case TTM_PL_VRAM:
- if (dev->pci_device == PCI_DEVICE_ID_VIA_VX900_VGA)
+ if (dev->pdev->device == PCI_DEVICE_ID_VIA_VX900_VGA)
mem->bus.base = pci_resource_start(dev->pdev, 2);
else
mem->bus.base = pci_resource_start(dev->pdev, 0);
More information about the Openchrome-devel
mailing list