Commit 90520b78 authored by Dave Airlie's avatar Dave Airlie

Merge branch 'drm-core-next' into drm-linus

* drm-core-next:
  drm/kms: Fix &&/|| confusion in drm_fb_helper_connector_parse_command_line()
  drm/edid: Fix CVT width/height decode
  drm/edid: Skip empty CVT codepoints
  drm: remove address mask param for drm_pci_alloc()
parents d94a5108 e89a8c90
...@@ -39,8 +39,7 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev, ...@@ -39,8 +39,7 @@ static int drm_ati_alloc_pcigart_table(struct drm_device *dev,
struct drm_ati_pcigart_info *gart_info) struct drm_ati_pcigart_info *gart_info)
{ {
gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size, gart_info->table_handle = drm_pci_alloc(dev, gart_info->table_size,
PAGE_SIZE, PAGE_SIZE);
gart_info->table_mask);
if (gart_info->table_handle == NULL) if (gart_info->table_handle == NULL)
return -ENOMEM; return -ENOMEM;
...@@ -112,6 +111,13 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga ...@@ -112,6 +111,13 @@ int drm_ati_pcigart_init(struct drm_device *dev, struct drm_ati_pcigart_info *ga
if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) { if (gart_info->gart_table_location == DRM_ATI_GART_MAIN) {
DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n"); DRM_DEBUG("PCI: no table in VRAM: using normal RAM\n");
if (pci_set_dma_mask(dev->pdev, gart_info->table_mask)) {
DRM_ERROR("fail to set dma mask to 0x%Lx\n",
gart_info->table_mask);
ret = 1;
goto done;
}
ret = drm_ati_alloc_pcigart_table(dev, gart_info); ret = drm_ati_alloc_pcigart_table(dev, gart_info);
if (ret) { if (ret) {
DRM_ERROR("cannot allocate PCI GART page!\n"); DRM_ERROR("cannot allocate PCI GART page!\n");
......
...@@ -326,7 +326,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset, ...@@ -326,7 +326,7 @@ static int drm_addmap_core(struct drm_device * dev, resource_size_t offset,
* As we're limiting the address to 2^32-1 (or less), * As we're limiting the address to 2^32-1 (or less),
* casting it down to 32 bits is no problem, but we * casting it down to 32 bits is no problem, but we
* need to point to a 64bit variable first. */ * need to point to a 64bit variable first. */
dmah = drm_pci_alloc(dev, map->size, map->size, 0xffffffffUL); dmah = drm_pci_alloc(dev, map->size, map->size);
if (!dmah) { if (!dmah) {
kfree(map); kfree(map);
return -ENOMEM; return -ENOMEM;
...@@ -885,7 +885,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request) ...@@ -885,7 +885,7 @@ int drm_addbufs_pci(struct drm_device * dev, struct drm_buf_desc * request)
while (entry->buf_count < count) { while (entry->buf_count < count) {
dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000, 0xfffffffful); dmah = drm_pci_alloc(dev, PAGE_SIZE << page_order, 0x1000);
if (!dmah) { if (!dmah) {
/* Set count correctly so we free the proper amount. */ /* Set count correctly so we free the proper amount. */
......
...@@ -911,23 +911,27 @@ static int drm_cvt_modes(struct drm_connector *connector, ...@@ -911,23 +911,27 @@ static int drm_cvt_modes(struct drm_connector *connector,
struct drm_device *dev = connector->dev; struct drm_device *dev = connector->dev;
struct cvt_timing *cvt; struct cvt_timing *cvt;
const int rates[] = { 60, 85, 75, 60, 50 }; const int rates[] = { 60, 85, 75, 60, 50 };
const u8 empty[3] = { 0, 0, 0 };
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
int uninitialized_var(width), height; int uninitialized_var(width), height;
cvt = &(timing->data.other_data.data.cvt[i]); cvt = &(timing->data.other_data.data.cvt[i]);
height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 8) + 1) * 2; if (!memcmp(cvt->code, empty, 3))
switch (cvt->code[1] & 0xc0) { continue;
height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2;
switch (cvt->code[1] & 0x0c) {
case 0x00: case 0x00:
width = height * 4 / 3; width = height * 4 / 3;
break; break;
case 0x40: case 0x04:
width = height * 16 / 9; width = height * 16 / 9;
break; break;
case 0x80: case 0x08:
width = height * 16 / 10; width = height * 16 / 10;
break; break;
case 0xc0: case 0x0c:
width = height * 15 / 9; width = height * 15 / 9;
break; break;
} }
......
...@@ -156,7 +156,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con ...@@ -156,7 +156,7 @@ static bool drm_fb_helper_connector_parse_command_line(struct drm_connector *con
force = DRM_FORCE_ON; force = DRM_FORCE_ON;
break; break;
case 'D': case 'D':
if ((connector->connector_type != DRM_MODE_CONNECTOR_DVII) || if ((connector->connector_type != DRM_MODE_CONNECTOR_DVII) &&
(connector->connector_type != DRM_MODE_CONNECTOR_HDMIB)) (connector->connector_type != DRM_MODE_CONNECTOR_HDMIB))
force = DRM_FORCE_ON; force = DRM_FORCE_ON;
else else
......
...@@ -47,8 +47,7 @@ ...@@ -47,8 +47,7 @@
/** /**
* \brief Allocate a PCI consistent memory block, for DMA. * \brief Allocate a PCI consistent memory block, for DMA.
*/ */
drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align, drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t align)
dma_addr_t maxaddr)
{ {
drm_dma_handle_t *dmah; drm_dma_handle_t *dmah;
#if 1 #if 1
...@@ -63,11 +62,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali ...@@ -63,11 +62,6 @@ drm_dma_handle_t *drm_pci_alloc(struct drm_device * dev, size_t size, size_t ali
if (align > size) if (align > size)
return NULL; return NULL;
if (pci_set_dma_mask(dev->pdev, maxaddr) != 0) {
DRM_ERROR("Setting pci dma mask failed\n");
return NULL;
}
dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL); dmah = kmalloc(sizeof(drm_dma_handle_t), GFP_KERNEL);
if (!dmah) if (!dmah)
return NULL; return NULL;
......
...@@ -123,7 +123,7 @@ static int i915_init_phys_hws(struct drm_device *dev) ...@@ -123,7 +123,7 @@ static int i915_init_phys_hws(struct drm_device *dev)
drm_i915_private_t *dev_priv = dev->dev_private; drm_i915_private_t *dev_priv = dev->dev_private;
/* Program Hardware Status Page */ /* Program Hardware Status Page */
dev_priv->status_page_dmah = dev_priv->status_page_dmah =
drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE, 0xffffffff); drm_pci_alloc(dev, PAGE_SIZE, PAGE_SIZE);
if (!dev_priv->status_page_dmah) { if (!dev_priv->status_page_dmah) {
DRM_ERROR("Can not allocate hardware status page\n"); DRM_ERROR("Can not allocate hardware status page\n");
......
...@@ -4708,7 +4708,7 @@ int i915_gem_init_phys_object(struct drm_device *dev, ...@@ -4708,7 +4708,7 @@ int i915_gem_init_phys_object(struct drm_device *dev,
phys_obj->id = id; phys_obj->id = id;
phys_obj->handle = drm_pci_alloc(dev, size, 0, 0xffffffff); phys_obj->handle = drm_pci_alloc(dev, size, 0);
if (!phys_obj->handle) { if (!phys_obj->handle) {
ret = -ENOMEM; ret = -ENOMEM;
goto kfree_obj; goto kfree_obj;
......
...@@ -1408,7 +1408,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev, ...@@ -1408,7 +1408,7 @@ extern int drm_ati_pcigart_cleanup(struct drm_device *dev,
struct drm_ati_pcigart_info * gart_info); struct drm_ati_pcigart_info * gart_info);
extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size, extern drm_dma_handle_t *drm_pci_alloc(struct drm_device *dev, size_t size,
size_t align, dma_addr_t maxaddr); size_t align);
extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); extern void __drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah); extern void drm_pci_free(struct drm_device *dev, drm_dma_handle_t * dmah);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment