Skip to content

Commit

Permalink
Merge branch 'master' of /Volumes/CaseSensitiveDisk/linux
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton Altaparmakov committed Feb 24, 2012
2 parents 97387e3 + bb4c7e9 commit 0afa1b6
Show file tree
Hide file tree
Showing 65 changed files with 473 additions and 466 deletions.
3 changes: 2 additions & 1 deletion arch/m68k/include/asm/mcf_pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@
| CF_PAGE_READABLE \
| CF_PAGE_WRITABLE \
| CF_PAGE_EXEC \
| CF_PAGE_SYSTEM)
| CF_PAGE_SYSTEM \
| CF_PAGE_SHARED)

#define PAGE_COPY __pgprot(CF_PAGE_VALID \
| CF_PAGE_ACCESSED \
Expand Down
9 changes: 5 additions & 4 deletions arch/m68k/mm/mcfmmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void __init paging_init(void)

int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
{
unsigned long flags, mmuar;
unsigned long flags, mmuar, mmutr;
struct mm_struct *mm;
pgd_t *pgd;
pmd_t *pmd;
Expand Down Expand Up @@ -137,9 +137,10 @@ int cf_tlb_miss(struct pt_regs *regs, int write, int dtlb, int extension_word)
if (!pte_dirty(*pte) && !KMAPAREA(mmuar))
set_pte(pte, pte_wrprotect(*pte));

mmu_write(MMUTR, (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) |
(((int)(pte->pte) & (int)CF_PAGE_MMUTR_MASK)
>> CF_PAGE_MMUTR_SHIFT) | MMUTR_V);
mmutr = (mmuar & PAGE_MASK) | (asid << MMUTR_IDN) | MMUTR_V;
if ((mmuar < TASK_UNMAPPED_BASE) || (mmuar >= TASK_SIZE))
mmutr |= (pte->pte & CF_PAGE_MMUTR_MASK) >> CF_PAGE_MMUTR_SHIFT;
mmu_write(MMUTR, mmutr);

mmu_write(MMUDR, (pte_val(*pte) & PAGE_MASK) |
((pte->pte) & CF_PAGE_MMUDR_MASK) | MMUDR_SZ_8KB | MMUDR_X);
Expand Down
4 changes: 1 addition & 3 deletions arch/m68k/platform/coldfire/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Luser_return:
movel %sp,%d1 /* get thread_info pointer */
andl #-THREAD_SIZE,%d1 /* at base of kernel stack */
movel %d1,%a0
movel %a0@(TINFO_FLAGS),%d1 /* get thread_info->flags */
moveb %a0@(TINFO_FLAGS+3),%d1 /* thread_info->flags (low 8 bits) */
jne Lwork_to_do /* still work to do */

Lreturn:
Expand All @@ -148,8 +148,6 @@ Lwork_to_do:
btst #TIF_NEED_RESCHED,%d1
jne reschedule

/* GERG: do we need something here for TRACEing?? */

Lsignal_return:
subql #4,%sp /* dummy return address */
SAVE_SWITCH_STACK
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/entry_32.S
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@ do_user_signal: /* r10 contains MSR_KERNEL here */
stw r3,_TRAP(r1)
2: addi r3,r1,STACK_FRAME_OVERHEAD
mr r4,r9
bl do_signal
bl do_notify_resume
REST_NVGPRS(r1)
b recheck

Expand Down
6 changes: 5 additions & 1 deletion arch/powerpc/kernel/entry_64.S
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,16 @@ user_work:

andi. r0,r4,_TIF_NEED_RESCHED
beq 1f
li r5,1
TRACE_AND_RESTORE_IRQ(r5);
bl .schedule
b .ret_from_except_lite

1: bl .save_nvgprs
li r5,1
TRACE_AND_RESTORE_IRQ(r5);
addi r3,r1,STACK_FRAME_OVERHEAD
bl .do_signal
bl .do_notify_resume
b .ret_from_except

unrecov_restore:
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/exceptions-64s.S
Original file line number Diff line number Diff line change
Expand Up @@ -774,8 +774,8 @@ alignment_common:
program_check_common:
EXCEPTION_PROLOG_COMMON(0x700, PACA_EXGEN)
bl .save_nvgprs
addi r3,r1,STACK_FRAME_OVERHEAD
DISABLE_INTS
addi r3,r1,STACK_FRAME_OVERHEAD
bl .program_check_exception
b .ret_from_except

Expand Down
12 changes: 8 additions & 4 deletions arch/powerpc/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include <linux/tracehook.h>
#include <linux/signal.h>
#include <linux/key.h>
#include <asm/hw_breakpoint.h>
#include <asm/uaccess.h>
#include <asm/unistd.h>
Expand Down Expand Up @@ -113,8 +114,9 @@ static void check_syscall_restart(struct pt_regs *regs, struct k_sigaction *ka,
}
}

static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
static int do_signal(struct pt_regs *regs)
{
sigset_t *oldset;
siginfo_t info;
int signr;
struct k_sigaction ka;
Expand All @@ -123,7 +125,7 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)

if (current_thread_info()->local_flags & _TLF_RESTORE_SIGMASK)
oldset = &current->saved_sigmask;
else if (!oldset)
else
oldset = &current->blocked;

signr = get_signal_to_deliver(&info, &ka, regs, NULL);
Expand Down Expand Up @@ -191,14 +193,16 @@ static int do_signal_pending(sigset_t *oldset, struct pt_regs *regs)
return ret;
}

void do_signal(struct pt_regs *regs, unsigned long thread_info_flags)
void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags)
{
if (thread_info_flags & _TIF_SIGPENDING)
do_signal_pending(NULL, regs);
do_signal(regs);

if (thread_info_flags & _TIF_NOTIFY_RESUME) {
clear_thread_flag(TIF_NOTIFY_RESUME);
tracehook_notify_resume(regs);
if (current->replacement_session_keyring)
key_replace_session_keyring();
}
}

Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/kernel/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#define _BLOCKABLE (~(sigmask(SIGKILL) | sigmask(SIGSTOP)))

extern void do_signal(struct pt_regs *regs, unsigned long thread_info_flags);
extern void do_notify_resume(struct pt_regs *regs, unsigned long thread_info_flags);

extern void __user * get_sigframe(struct k_sigaction *ka, struct pt_regs *regs,
size_t frame_size, int is_32);
Expand Down
2 changes: 1 addition & 1 deletion arch/powerpc/platforms/wsp/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ int __devinit smp_a2_kick_cpu(int nr)

static int __init smp_a2_probe(void)
{
return cpus_weight(cpu_possible_map);
return num_possible_cpus();
}

static struct smp_ops_t a2_smp_ops = {
Expand Down
2 changes: 1 addition & 1 deletion drivers/cpuidle/Kconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

config CPU_IDLE
bool "CPU idle PM support"
default ACPI
default y if ACPI || PPC_PSERIES
help
CPU idle is a generic framework for supporting software-controlled
idle processor power management. It includes modular cross-platform
Expand Down
3 changes: 3 additions & 0 deletions drivers/gpu/drm/exynos/exynos_drm_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,9 @@ int exynos_drm_subdrv_register(struct exynos_drm_subdrv *subdrv)
return err;
}

/* setup possible_clones. */
exynos_drm_encoder_setup(drm_dev);

/*
* if any specific driver such as fimd or hdmi driver called
* exynos_drm_subdrv_register() later than drm_load(),
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpu/drm/exynos/exynos_drm_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,9 +307,6 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
*/
event->pipe = exynos_crtc->pipe;

list_add_tail(&event->base.link,
&dev_priv->pageflip_event_list);

ret = drm_vblank_get(dev, exynos_crtc->pipe);
if (ret) {
DRM_DEBUG("failed to acquire vblank counter\n");
Expand All @@ -318,6 +315,9 @@ static int exynos_drm_crtc_page_flip(struct drm_crtc *crtc,
goto out;
}

list_add_tail(&event->base.link,
&dev_priv->pageflip_event_list);

crtc->fb = fb;
ret = exynos_drm_crtc_update(crtc);
if (ret) {
Expand Down
26 changes: 18 additions & 8 deletions drivers/gpu/drm/exynos/exynos_drm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@

#include "exynos_drm_drv.h"
#include "exynos_drm_crtc.h"
#include "exynos_drm_encoder.h"
#include "exynos_drm_fbdev.h"
#include "exynos_drm_fb.h"
#include "exynos_drm_gem.h"
Expand Down Expand Up @@ -99,6 +100,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags)
if (ret)
goto err_vblank;

/* setup possible_clones. */
exynos_drm_encoder_setup(dev);

/*
* create and configure fb helper and also exynos specific
* fbdev object.
Expand Down Expand Up @@ -141,16 +145,21 @@ static int exynos_drm_unload(struct drm_device *dev)
}

static void exynos_drm_preclose(struct drm_device *dev,
struct drm_file *file_priv)
struct drm_file *file)
{
struct exynos_drm_private *dev_priv = dev->dev_private;
DRM_DEBUG_DRIVER("%s\n", __FILE__);

/*
* drm framework frees all events at release time,
* so private event list should be cleared.
*/
if (!list_empty(&dev_priv->pageflip_event_list))
INIT_LIST_HEAD(&dev_priv->pageflip_event_list);
}

static void exynos_drm_postclose(struct drm_device *dev, struct drm_file *file)
{
DRM_DEBUG_DRIVER("%s\n", __FILE__);

if (!file->driver_priv)
return;

kfree(file->driver_priv);
file->driver_priv = NULL;
}

static void exynos_drm_lastclose(struct drm_device *dev)
Expand Down Expand Up @@ -195,6 +204,7 @@ static struct drm_driver exynos_drm_driver = {
.unload = exynos_drm_unload,
.preclose = exynos_drm_preclose,
.lastclose = exynos_drm_lastclose,
.postclose = exynos_drm_postclose,
.get_vblank_counter = drm_vblank_count,
.enable_vblank = exynos_drm_crtc_enable_vblank,
.disable_vblank = exynos_drm_crtc_disable_vblank,
Expand Down
34 changes: 34 additions & 0 deletions drivers/gpu/drm/exynos/exynos_drm_encoder.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,40 @@ static struct drm_encoder_funcs exynos_encoder_funcs = {
.destroy = exynos_drm_encoder_destroy,
};

static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder)
{
struct drm_encoder *clone;
struct drm_device *dev = encoder->dev;
struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder);
struct exynos_drm_display_ops *display_ops =
exynos_encoder->manager->display_ops;
unsigned int clone_mask = 0;
int cnt = 0;

list_for_each_entry(clone, &dev->mode_config.encoder_list, head) {
switch (display_ops->type) {
case EXYNOS_DISPLAY_TYPE_LCD:
case EXYNOS_DISPLAY_TYPE_HDMI:
clone_mask |= (1 << (cnt++));
break;
default:
continue;
}
}

return clone_mask;
}

void exynos_drm_encoder_setup(struct drm_device *dev)
{
struct drm_encoder *encoder;

DRM_DEBUG_KMS("%s\n", __FILE__);

list_for_each_entry(encoder, &dev->mode_config.encoder_list, head)
encoder->possible_clones = exynos_drm_encoder_clones(encoder);
}

struct drm_encoder *
exynos_drm_encoder_create(struct drm_device *dev,
struct exynos_drm_manager *manager,
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/exynos/exynos_drm_encoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@

struct exynos_drm_manager;

void exynos_drm_encoder_setup(struct drm_device *dev);
struct drm_encoder *exynos_drm_encoder_create(struct drm_device *dev,
struct exynos_drm_manager *mgr,
unsigned int possible_crtcs);
Expand Down
70 changes: 4 additions & 66 deletions drivers/gpu/drm/exynos/exynos_drm_fbdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,73 +195,17 @@ static int exynos_drm_fbdev_create(struct drm_fb_helper *helper,
return ret;
}

static bool
exynos_drm_fbdev_is_samefb(struct drm_framebuffer *fb,
struct drm_fb_helper_surface_size *sizes)
{
if (fb->width != sizes->surface_width)
return false;
if (fb->height != sizes->surface_height)
return false;
if (fb->bits_per_pixel != sizes->surface_bpp)
return false;
if (fb->depth != sizes->surface_depth)
return false;

return true;
}

static int exynos_drm_fbdev_recreate(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
struct drm_device *dev = helper->dev;
struct exynos_drm_fbdev *exynos_fbdev = to_exynos_fbdev(helper);
struct exynos_drm_gem_obj *exynos_gem_obj;
struct drm_framebuffer *fb = helper->fb;
struct drm_mode_fb_cmd2 mode_cmd = { 0 };
unsigned long size;

DRM_DEBUG_KMS("%s\n", __FILE__);

if (exynos_drm_fbdev_is_samefb(fb, sizes))
return 0;

mode_cmd.width = sizes->surface_width;
mode_cmd.height = sizes->surface_height;
mode_cmd.pitches[0] = sizes->surface_width * (sizes->surface_bpp >> 3);
mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
sizes->surface_depth);

if (exynos_fbdev->exynos_gem_obj)
exynos_drm_gem_destroy(exynos_fbdev->exynos_gem_obj);

if (fb->funcs->destroy)
fb->funcs->destroy(fb);

size = mode_cmd.pitches[0] * mode_cmd.height;
exynos_gem_obj = exynos_drm_gem_create(dev, size);
if (IS_ERR(exynos_gem_obj))
return PTR_ERR(exynos_gem_obj);

exynos_fbdev->exynos_gem_obj = exynos_gem_obj;

helper->fb = exynos_drm_framebuffer_init(dev, &mode_cmd,
&exynos_gem_obj->base);
if (IS_ERR_OR_NULL(helper->fb)) {
DRM_ERROR("failed to create drm framebuffer.\n");
return PTR_ERR(helper->fb);
}

return exynos_drm_fbdev_update(helper, helper->fb);
}

static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
struct drm_fb_helper_surface_size *sizes)
{
int ret = 0;

DRM_DEBUG_KMS("%s\n", __FILE__);

/*
* with !helper->fb, it means that this funcion is called first time
* and after that, the helper->fb would be used as clone mode.
*/
if (!helper->fb) {
ret = exynos_drm_fbdev_create(helper, sizes);
if (ret < 0) {
Expand All @@ -274,12 +218,6 @@ static int exynos_drm_fbdev_probe(struct drm_fb_helper *helper,
* because register_framebuffer() should be called.
*/
ret = 1;
} else {
ret = exynos_drm_fbdev_recreate(helper, sizes);
if (ret < 0) {
DRM_ERROR("failed to reconfigure fbdev\n");
return ret;
}
}

return ret;
Expand Down
Loading

0 comments on commit 0afa1b6

Please sign in to comment.