Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228854
b: refs/heads/master
c: 3313e3d
h: refs/heads/master
v: v3
  • Loading branch information
Alex Deucher authored and Dave Airlie committed Jan 7, 2011
1 parent f79fd32 commit 970183b
Show file tree
Hide file tree
Showing 28 changed files with 255 additions and 182 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0ba41e449fd0f45f5b29c1009020ab1b298bedda
refs/heads/master: 3313e3d4333ccbf8bd7c816775cfe9aca623bd8a
5 changes: 1 addition & 4 deletions trunk/drivers/gpu/drm/drm_crtc_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,6 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
old_fb)) {
DRM_ERROR("failed to set mode on [CRTC:%d]\n",
set->crtc->base.id);
set->crtc->fb = old_fb;
ret = -EINVAL;
goto fail;
}
Expand All @@ -676,10 +675,8 @@ int drm_crtc_helper_set_config(struct drm_mode_set *set)
set->crtc->fb = set->fb;
ret = crtc_funcs->mode_set_base(set->crtc,
set->x, set->y, old_fb);
if (ret != 0) {
set->crtc->fb = old_fb;
if (ret != 0)
goto fail;
}
}
DRM_DEBUG_KMS("Setting connector DPMS state to on\n");
for (i = 0; i < set->num_connectors; i++) {
Expand Down
41 changes: 20 additions & 21 deletions trunk/drivers/gpu/drm/drm_fb_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -607,25 +607,6 @@ void drm_fb_helper_fini(struct drm_fb_helper *fb_helper)
}
EXPORT_SYMBOL(drm_fb_helper_fini);

void drm_fb_helper_fill_fix(struct fb_info *info, struct drm_framebuffer *fb)
{
info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = fb->depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
FB_VISUAL_TRUECOLOR;
info->fix.mmio_start = 0;
info->fix.mmio_len = 0;
info->fix.type_aux = 0;
info->fix.xpanstep = 1; /* doing it in hw */
info->fix.ypanstep = 1; /* doing it in hw */
info->fix.ywrapstep = 0;
info->fix.accel = FB_ACCEL_NONE;
info->fix.type_aux = 0;

info->fix.line_length = fb->pitch;
return;
}
EXPORT_SYMBOL(drm_fb_helper_fill_fix);

static int setcolreg(struct drm_crtc *crtc, u16 red, u16 green,
u16 blue, u16 regno, struct fb_info *info)
{
Expand Down Expand Up @@ -835,7 +816,6 @@ int drm_fb_helper_set_par(struct fb_info *info)
mutex_unlock(&dev->mode_config.mutex);
return ret;
}
drm_fb_helper_fill_fix(info, fb_helper->fb);
}
mutex_unlock(&dev->mode_config.mutex);

Expand Down Expand Up @@ -973,7 +953,6 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,

if (new_fb) {
info->var.pixclock = 0;
drm_fb_helper_fill_fix(info, fb_helper->fb);
if (register_framebuffer(info) < 0) {
return -EINVAL;
}
Expand All @@ -1000,6 +979,26 @@ int drm_fb_helper_single_fb_probe(struct drm_fb_helper *fb_helper,
}
EXPORT_SYMBOL(drm_fb_helper_single_fb_probe);

void drm_fb_helper_fill_fix(struct fb_info *info, uint32_t pitch,
uint32_t depth)
{
info->fix.type = FB_TYPE_PACKED_PIXELS;
info->fix.visual = depth == 8 ? FB_VISUAL_PSEUDOCOLOR :
FB_VISUAL_TRUECOLOR;
info->fix.mmio_start = 0;
info->fix.mmio_len = 0;
info->fix.type_aux = 0;
info->fix.xpanstep = 1; /* doing it in hw */
info->fix.ypanstep = 1; /* doing it in hw */
info->fix.ywrapstep = 0;
info->fix.accel = FB_ACCEL_NONE;
info->fix.type_aux = 0;

info->fix.line_length = pitch;
return;
}
EXPORT_SYMBOL(drm_fb_helper_fill_fix);

void drm_fb_helper_fill_var(struct fb_info *info, struct drm_fb_helper *fb_helper,
uint32_t fb_width, uint32_t fb_height)
{
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/i915/intel_fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ static int intelfb_create(struct intel_fbdev *ifbdev,

// memset(info->screen_base, 0, size);

drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);

info->pixmap.size = 64*1024;
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/nouveau/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ config DRM_NOUVEAU
select FB
select FRAMEBUFFER_CONSOLE if !EMBEDDED
select FB_BACKLIGHT if DRM_NOUVEAU_BACKLIGHT
select ACPI_VIDEO if ACPI && X86 && BACKLIGHT_CLASS_DEVICE && VIDEO_OUTPUT_CONTROL && INPUT
select ACPI_VIDEO if ACPI
help
Choose this option for open-source nVidia support.

Expand Down
35 changes: 18 additions & 17 deletions trunk/drivers/gpu/drm/nouveau/nouveau_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
uint32_t vram_handle, uint32_t gart_handle)
{
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
struct nouveau_channel *chan;
unsigned long flags;
Expand Down Expand Up @@ -201,6 +202,15 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
/* disable the fifo caches */
pfifo->reassign(dev, false);

/* Create a graphics context for new channel */
if (dev_priv->card_type < NV_50) {
ret = pgraph->create_context(chan);
if (ret) {
nouveau_channel_put(&chan);
return ret;
}
}

/* Construct inital RAMFC for new channel */
ret = pfifo->create_context(chan);
if (ret) {
Expand Down Expand Up @@ -243,9 +253,6 @@ nouveau_channel_get(struct drm_device *dev, struct drm_file *file_priv, int id)
struct nouveau_channel *chan;
unsigned long flags;

if (unlikely(id < 0 || id >= NOUVEAU_MAX_CHANNEL_NR))
return ERR_PTR(-EINVAL);

spin_lock_irqsave(&dev_priv->channels.lock, flags);
chan = nouveau_channel_get_unlocked(dev_priv->channels.ptr[id]);
spin_unlock_irqrestore(&dev_priv->channels.lock, flags);
Expand Down Expand Up @@ -436,20 +443,14 @@ nouveau_ioctl_fifo_alloc(struct drm_device *dev, void *data,
else
init->pushbuf_domains = NOUVEAU_GEM_DOMAIN_GART;

if (dev_priv->card_type < NV_C0) {
init->subchan[0].handle = NvM2MF;
if (dev_priv->card_type < NV_50)
init->subchan[0].grclass = 0x0039;
else
init->subchan[0].grclass = 0x5039;
init->subchan[1].handle = NvSw;
init->subchan[1].grclass = NV_SW;
init->nr_subchan = 2;
} else {
init->subchan[0].handle = 0x9039;
init->subchan[0].grclass = 0x9039;
init->nr_subchan = 1;
}
init->subchan[0].handle = NvM2MF;
if (dev_priv->card_type < NV_50)
init->subchan[0].grclass = 0x0039;
else
init->subchan[0].grclass = 0x5039;
init->subchan[1].handle = NvSw;
init->subchan[1].grclass = NV_SW;
init->nr_subchan = 2;

/* Named memory object area */
ret = drm_gem_handle_create(file_priv, chan->notifier_bo->gem,
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,6 @@ extern int nv50_graph_unload_context(struct drm_device *);
extern int nv50_grctx_init(struct nouveau_grctx *);
extern void nv50_graph_tlb_flush(struct drm_device *dev);
extern void nv86_graph_tlb_flush(struct drm_device *dev);
extern struct nouveau_enum nv50_data_error_names[];

/* nvc0_graph.c */
extern int nvc0_graph_init(struct drm_device *);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/nouveau/nouveau_fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ nouveau_fbcon_create(struct nouveau_fbdev *nfbdev,
info->screen_base = nvbo_kmap_obj_iovirtual(nouveau_fb->nvbo);
info->screen_size = size;

drm_fb_helper_fill_fix(info, fb->pitch, fb->depth);
drm_fb_helper_fill_var(info, &nfbdev->helper, sizes->fb_width, sizes->fb_height);

/* Set aperture base/size for vesafb takeover */
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_fence.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ nouveau_fence_emit(struct nouveau_fence *fence)
if (dev_priv->card_type < NV_C0)
BEGIN_RING(chan, NvSubSw, 0x0050, 1);
else
BEGIN_NVC0(chan, 2, NvSubM2MF, 0x0050, 1);
BEGIN_NVC0(chan, 2, NvSubSw, 0x0050, 1);
} else {
BEGIN_RING(chan, NvSubSw, 0x0150, 1);
}
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/gpu/drm/nouveau/nouveau_object.c
Original file line number Diff line number Diff line change
Expand Up @@ -651,8 +651,7 @@ nouveau_gpuobj_gr_new(struct nouveau_channel *chan, u32 handle, int class)
}
break;
case NVOBJ_ENGINE_GR:
if ((dev_priv->card_type >= NV_20 && !chan->ramin_grctx) ||
(dev_priv->card_type < NV_20 && !chan->pgraph_ctx)) {
if (dev_priv->card_type >= NV_50 && !chan->ramin_grctx) {
struct nouveau_pgraph_engine *pgraph =
&dev_priv->engine.graph;

Expand Down
3 changes: 2 additions & 1 deletion trunk/drivers/gpu/drm/nouveau/nouveau_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,8 @@ nouveau_hwmon_init(struct drm_device *dev)
return ret;
}
dev_set_drvdata(hwmon_dev, dev);
ret = sysfs_create_group(&dev->pdev->dev.kobj, &hwmon_attrgroup);
ret = sysfs_create_group(&hwmon_dev->kobj,
&hwmon_attrgroup);
if (ret) {
NV_ERROR(dev,
"Unable to create hwmon sysfs file: %d\n", ret);
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/gpu/drm/nouveau/nv40_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ nv40_fifo_create_context(struct nouveau_channel *chan)
NV_PFIFO_CACHE1_BIG_ENDIAN |
#endif
0x30000000 /* no idea.. */);
nv_wi32(dev, fc + 56, chan->ramin_grctx->pinst >> 4);
nv_wi32(dev, fc + 60, 0x0001FFFF);

/* enable the fifo dma operation */
Expand Down
12 changes: 0 additions & 12 deletions trunk/drivers/gpu/drm/nouveau/nv40_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ nv40_graph_create_context(struct nouveau_channel *chan)
struct drm_nouveau_private *dev_priv = dev->dev_private;
struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
struct nouveau_grctx ctx = {};
unsigned long flags;
int ret;

ret = nouveau_gpuobj_new(dev, chan, pgraph->grctx_size, 16,
Expand All @@ -77,17 +76,6 @@ nv40_graph_create_context(struct nouveau_channel *chan)
nv40_grctx_init(&ctx);

nv_wo32(chan->ramin_grctx, 0, chan->ramin_grctx->pinst);

/* init grctx pointer in ramfc, and on PFIFO if channel is
* already active there
*/
spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
nv_wo32(chan->ramfc, 0x38, chan->ramin_grctx->pinst >> 4);
nv_mask(dev, 0x002500, 0x00000001, 0x00000000);
if ((nv_rd32(dev, 0x003204) & 0x0000001f) == chan->id)
nv_wr32(dev, 0x0032e0, chan->ramin_grctx->pinst >> 4);
nv_mask(dev, 0x002500, 0x00000001, 0x00000001);
spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
return 0;
}

Expand Down
49 changes: 7 additions & 42 deletions trunk/drivers/gpu/drm/nouveau/nv50_graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,48 +554,13 @@ static struct nouveau_bitfield nv50_graph_trap_ccache[] = {
};

/* There must be a *lot* of these. Will take some time to gather them up. */
struct nouveau_enum nv50_data_error_names[] = {
{ 0x00000003, "INVALID_QUERY_OR_TEXTURE" },
{ 0x00000004, "INVALID_VALUE" },
{ 0x00000005, "INVALID_ENUM" },
{ 0x00000008, "INVALID_OBJECT" },
{ 0x00000009, "READ_ONLY_OBJECT" },
{ 0x0000000a, "SUPERVISOR_OBJECT" },
{ 0x0000000b, "INVALID_ADDRESS_ALIGNMENT" },
{ 0x0000000c, "INVALID_BITFIELD" },
{ 0x0000000d, "BEGIN_END_ACTIVE" },
{ 0x0000000e, "SEMANTIC_COLOR_BACK_OVER_LIMIT" },
{ 0x0000000f, "VIEWPORT_ID_NEEDS_GP" },
{ 0x00000010, "RT_DOUBLE_BIND" },
{ 0x00000011, "RT_TYPES_MISMATCH" },
{ 0x00000012, "RT_LINEAR_WITH_ZETA" },
{ 0x00000015, "FP_TOO_FEW_REGS" },
{ 0x00000016, "ZETA_FORMAT_CSAA_MISMATCH" },
{ 0x00000017, "RT_LINEAR_WITH_MSAA" },
{ 0x00000018, "FP_INTERPOLANT_START_OVER_LIMIT" },
{ 0x00000019, "SEMANTIC_LAYER_OVER_LIMIT" },
{ 0x0000001a, "RT_INVALID_ALIGNMENT" },
{ 0x0000001b, "SAMPLER_OVER_LIMIT" },
{ 0x0000001c, "TEXTURE_OVER_LIMIT" },
{ 0x0000001e, "GP_TOO_MANY_OUTPUTS" },
{ 0x0000001f, "RT_BPP128_WITH_MS8" },
{ 0x00000021, "Z_OUT_OF_BOUNDS" },
{ 0x00000023, "XY_OUT_OF_BOUNDS" },
{ 0x00000027, "CP_MORE_PARAMS_THAN_SHARED" },
{ 0x00000028, "CP_NO_REG_SPACE_STRIPED" },
{ 0x00000029, "CP_NO_REG_SPACE_PACKED" },
{ 0x0000002a, "CP_NOT_ENOUGH_WARPS" },
{ 0x0000002b, "CP_BLOCK_SIZE_MISMATCH" },
{ 0x0000002c, "CP_NOT_ENOUGH_LOCAL_WARPS" },
{ 0x0000002d, "CP_NOT_ENOUGH_STACK_WARPS" },
{ 0x0000002e, "CP_NO_BLOCKDIM_LATCH" },
{ 0x00000031, "ENG2D_FORMAT_MISMATCH" },
{ 0x0000003f, "PRIMITIVE_ID_NEEDS_GP" },
{ 0x00000044, "SEMANTIC_VIEWPORT_OVER_LIMIT" },
{ 0x00000045, "SEMANTIC_COLOR_FRONT_OVER_LIMIT" },
{ 0x00000046, "LAYER_ID_NEEDS_GP" },
{ 0x00000047, "SEMANTIC_CLIP_OVER_LIMIT" },
{ 0x00000048, "SEMANTIC_PTSZ_OVER_LIMIT" },
static struct nouveau_enum nv50_data_error_names[] = {
{ 4, "INVALID_VALUE" },
{ 5, "INVALID_ENUM" },
{ 8, "INVALID_OBJECT" },
{ 0xc, "INVALID_BITFIELD" },
{ 0x28, "MP_NO_REG_SPACE" },
{ 0x2b, "MP_BLOCK_SIZE_MISMATCH" },
{}
};

Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nvc0_fbcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ nvc0_fbcon_accel_init(struct fb_info *info)
return ret;
}

printk(KERN_ERR "fb vma 0x%010llx\n", nvbo->vma.offset);

BEGIN_NVC0(chan, 2, NvSub2D, 0x0000, 1);
OUT_RING (chan, 0x0000902d);
BEGIN_NVC0(chan, 2, NvSub2D, 0x0104, 2);
Expand Down
18 changes: 6 additions & 12 deletions trunk/drivers/gpu/drm/nouveau/nvc0_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ struct nvc0_fifo_priv {
struct nouveau_gpuobj *playlist[2];
int cur_playlist;
struct nouveau_vma user_vma;
int spoon_nr;
};

struct nvc0_fifo_chan {
Expand Down Expand Up @@ -325,18 +324,13 @@ nvc0_fifo_init(struct drm_device *dev)
nv_wr32(dev, 0x000204, 0xffffffff);
nv_wr32(dev, 0x002204, 0xffffffff);

priv->spoon_nr = hweight32(nv_rd32(dev, 0x002204));
NV_DEBUG(dev, "PFIFO: %d subfifo(s)\n", priv->spoon_nr);

/* assign engines to subfifos */
if (priv->spoon_nr >= 3) {
nv_wr32(dev, 0x002208, ~(1 << 0)); /* PGRAPH */
nv_wr32(dev, 0x00220c, ~(1 << 1)); /* PVP */
nv_wr32(dev, 0x002210, ~(1 << 1)); /* PPP */
nv_wr32(dev, 0x002214, ~(1 << 1)); /* PBSP */
nv_wr32(dev, 0x002218, ~(1 << 2)); /* PCE0 */
nv_wr32(dev, 0x00221c, ~(1 << 1)); /* PCE1 */
}
nv_wr32(dev, 0x002208, ~(1 << 0)); /* PGRAPH */
nv_wr32(dev, 0x00220c, ~(1 << 1)); /* PVP */
nv_wr32(dev, 0x002210, ~(1 << 1)); /* PPP */
nv_wr32(dev, 0x002214, ~(1 << 1)); /* PBSP */
nv_wr32(dev, 0x002218, ~(1 << 2)); /* PCE0 */
nv_wr32(dev, 0x00221c, ~(1 << 1)); /* PCE1 */

/* PSUBFIFO[n] */
for (i = 0; i < 3; i++) {
Expand Down
Loading

0 comments on commit 970183b

Please sign in to comment.