Skip to content

Commit

Permalink
Merge tag 'drm-misc-next-fixes-2024-03-07' of https://anongit.freedes…
Browse files Browse the repository at this point in the history
…ktop.org/git/drm/drm-misc into drm-next

Short summary of fixes pull:

- i915: Fix applying placement flags
- fbdev: Fix build on PowerMacs after header cleanup

Signed-off-by: Dave Airlie <[email protected]>

From: Thomas Zimmermann <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
  • Loading branch information
airlied committed Mar 8, 2024
2 parents af165fb + 838f865 commit 098ca76
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 30 deletions.
5 changes: 2 additions & 3 deletions arch/powerpc/include/asm/backlight.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@
#define __ASM_POWERPC_BACKLIGHT_H
#ifdef __KERNEL__

#include <linux/fb.h>
#include <linux/mutex.h>

struct backlight_device;

/* For locking instructions, see the implementation file */
extern struct backlight_device *pmac_backlight;
extern struct mutex pmac_backlight_mutex;

extern int pmac_backlight_curve_lookup(struct fb_info *info, int value);

extern int pmac_has_backlight_type(const char *type);

extern void pmac_backlight_key(int direction);
Expand Down
26 changes: 0 additions & 26 deletions arch/powerpc/platforms/powermac/backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
*/

#include <linux/kernel.h>
#include <linux/fb.h>
#include <linux/backlight.h>
#include <linux/adb.h>
#include <linux/pmu.h>
Expand Down Expand Up @@ -72,31 +71,6 @@ int pmac_has_backlight_type(const char *type)
return 0;
}

int pmac_backlight_curve_lookup(struct fb_info *info, int value)
{
int level = (FB_BACKLIGHT_LEVELS - 1);

if (info && info->bl_dev) {
int i, max = 0;

/* Look for biggest value */
for (i = 0; i < FB_BACKLIGHT_LEVELS; i++)
max = max((int)info->bl_curve[i], max);

/* Look for nearest value */
for (i = 0; i < FB_BACKLIGHT_LEVELS; i++) {
int diff = abs(info->bl_curve[i] - value);
if (diff < max) {
max = diff;
level = i;
}
}

}

return level;
}

static void pmac_backlight_key_worker(struct work_struct *work)
{
if (atomic_read(&kernel_backlight_disabled))
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpu/drm/i915/gem/i915_gem_ttm.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,10 @@ i915_ttm_placement_from_obj(const struct drm_i915_gem_object *obj,
unsigned int flags = obj->flags;
unsigned int i;

places[0].flags |= TTM_PL_FLAG_DESIRED;
i915_ttm_place_from_region(num_allowed ? obj->mm.placements[0] :
obj->mm.region, &places[0], obj->bo_offset,
obj->base.size, flags);
places[0].flags |= TTM_PL_FLAG_DESIRED;

/* Cache this on object? */
for (i = 0; i < num_allowed; ++i) {
Expand Down
1 change: 1 addition & 0 deletions drivers/macintosh/via-pmu-backlight.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include <asm/ptrace.h>
#include <linux/adb.h>
#include <linux/backlight.h>
#include <linux/pmu.h>
#include <asm/backlight.h>

Expand Down
1 change: 1 addition & 0 deletions drivers/video/fbdev/chipsfb.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
*/

#include <linux/aperture.h>
#include <linux/backlight.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
Expand Down

0 comments on commit 098ca76

Please sign in to comment.